示例#1
0
def createFluidMeshes( rp, runTime ) :

    from Foam.finiteVolume import fvMesh, PtrList_fvMesh
    fluidRegions = PtrList_fvMesh( rp.fluidRegionNames.size() )
    from Foam.OpenFOAM import word, fileName, IOobject
    for index in range( rp.fluidRegionNames.size() ) :

        from Foam.OpenFOAM import ext_Info, nl
        ext_Info()<< "Create fluid mesh for region " << rp.fluidRegionNames[ index ] \
                  << " for time = " << runTime.timeName() << nl << nl
        mesh = fvMesh( IOobject( rp.fluidRegionNames[ index ],
                                 fileName( runTime.timeName() ),
                                 runTime,
                                 IOobject.MUST_READ ) ) 

        fluidRegions.ext_set( index, mesh )
        # Force calculation of geometric properties to prevent it being done
        # later in e.g. some boundary evaluation
        # (void)fluidRegions[i].weights();
        # (void)fluidRegions[i].deltaCoeffs();
        
        from Foam.OpenFOAM import IOdictionary, autoPtr_IOdictionary
        # Attach environmental properties to each region
        environmentalProperties = autoPtr_IOdictionary( IOdictionary( IOobject( word( "environmentalProperties" ),
                                                                                fileName( runTime.constant() ),
                                                                                fluidRegions[ index ],
                                                                                IOobject.MUST_READ,
                                                                                IOobject.NO_WRITE ) ) )
        
        environmentalProperties.ptr().store()
                
    return fluidRegions
示例#2
0
def createSolidMeshes( rp, runTime ):
    
    from Foam.finiteVolume import PtrList_fvMesh, fvMesh
    solidRegions = PtrList_fvMesh( rp.solidRegionNames.size() )
    
    from Foam.OpenFOAM import word, fileName, IOobject
    for index in range( solidRegions.size() ):
        from Foam.OpenFOAM import ext_Info, nl
        ext_Info()<< "Create solid mesh for region " << rp.solidRegionNames[ index ] \
            << " for time = " << runTime.timeName() << nl << nl
        
        solidRegions.ext_set(index, fvMesh( IOobject ( word( rp.solidRegionNames[ index ] ),
                                                       fileName( runTime.timeName() ),
                                                       runTime,
                                                       IOobject.MUST_READ ) ) )
        pass

    return solidRegions
示例#3
0
def createFluidMeshes( rp, runTime ) :
    
    from Foam.finiteVolume import fvMesh, PtrList_fvMesh
    fluidRegions = PtrList_fvMesh( rp.fluidRegionNames().size() )
    
    from Foam.OpenFOAM import word, fileName, IOobject
    for index in range( rp.fluidRegionNames().size() ) :
        from Foam.OpenFOAM import ext_Info, nl
        ext_Info()<< "Create fluid mesh for region " << rp.fluidRegionNames()[ index ] \
                  << " for time = " << runTime.timeName() << nl << nl
        mesh = fvMesh( IOobject( rp.fluidRegionNames()[ index ],
                                 fileName( runTime.timeName() ),
                                 runTime,
                                 IOobject.MUST_READ ) )
        fluidRegions.ext_set( index, mesh )
        pass
    
    return fluidRegions
示例#4
0
def createFluidMeshes(rp, runTime):

    from Foam.finiteVolume import fvMesh, PtrList_fvMesh
    fluidRegions = PtrList_fvMesh(rp.fluidRegionNames().size())

    from Foam.OpenFOAM import word, fileName, IOobject
    for index in range(rp.fluidRegionNames().size()):
        from Foam.OpenFOAM import ext_Info, nl
        ext_Info()<< "Create fluid mesh for region " << rp.fluidRegionNames()[ index ] \
                  << " for time = " << runTime.timeName() << nl << nl
        mesh = fvMesh(
            IOobject(rp.fluidRegionNames()[index],
                     fileName(runTime.timeName()), runTime,
                     IOobject.MUST_READ))
        fluidRegions.ext_set(index, mesh)
        pass

    return fluidRegions
示例#5
0
def createSolidMeshes( rp, runTime ):
    
    from Foam.finiteVolume import PtrList_fvMesh, fvMesh
    solidRegions = PtrList_fvMesh( rp.solidRegionNames().size() )
    
    from Foam.OpenFOAM import word, fileName, IOobject
    for index in range( solidRegions.size() ):
        from Foam.OpenFOAM import ext_Info, nl
        ext_Info()<< "Create solid mesh for region " << rp.solidRegionNames()[ index ] \
            << " for time = " << runTime.timeName() << nl << nl
        
        solidRegions.ext_set(index, fvMesh( IOobject ( word( rp.solidRegionNames()[ index ] ),
                                                       fileName( runTime.timeName() ),
                                                       runTime,
                                                       IOobject.MUST_READ ) ) )
        pass

    return solidRegions
示例#6
0
def createSolidMeshes( rp, runTime ):
    
    from Foam.finiteVolume import PtrList_fvMesh, fvMesh
    solidRegions = PtrList_fvMesh( rp.solidRegionNames.size() )
    
    from Foam.OpenFOAM import word, fileName, IOobject
    for index in range( solidRegions.size() ):
        from Foam.OpenFOAM import ext_Info, nl
        ext_Info()<< "Create solid mesh for region " << rp.solidRegionNames[ index ] \
            << " for time = " << runTime.timeName() << nl << nl
        
        solidRegions.ext_set(index, fvMesh( IOobject ( word( rp.solidRegionNames[ index ] ),
                                                       fileName( runTime.timeName() ),
                                                       runTime,
                                                       IOobject.MUST_READ ) ) )
        pass
    # Force calculation of geometric properties to prevent it being done
    # later in e.g. some boundary evaluation
    # (void)solidRegions[i].weights();
    # (void)solidRegions[i].deltaCoeffs();
    
    return solidRegions
示例#7
0
def createSolidMeshes(rp, runTime):

    from Foam.finiteVolume import PtrList_fvMesh, fvMesh
    solidRegions = PtrList_fvMesh(rp.solidRegionNames.size())

    from Foam.OpenFOAM import word, fileName, IOobject
    for index in range(solidRegions.size()):
        from Foam.OpenFOAM import ext_Info, nl
        ext_Info()<< "Create solid mesh for region " << rp.solidRegionNames[ index ] \
            << " for time = " << runTime.timeName() << nl << nl

        solidRegions.ext_set(
            index,
            fvMesh(
                IOobject(word(rp.solidRegionNames[index]),
                         fileName(runTime.timeName()), runTime,
                         IOobject.MUST_READ)))
        pass
    # Force calculation of geometric properties to prevent it being done
    # later in e.g. some boundary evaluation
    # (void)solidRegions[i].weights();
    # (void)solidRegions[i].deltaCoeffs();

    return solidRegions