Esempio n. 1
0
def createFields(runTime, mesh, pimple):
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl

    pThermo = man.basicPsiThermo.New(mesh)

    p = man.volScalarField(pThermo.p(), man.Deps(pThermo))
    h = man.volScalarField(pThermo.h(), man.Deps(pThermo))
    psi = man.volScalarField(pThermo.psi(), man.Deps(pThermo))

    rho = man.volScalarField(
        man.IOobject(ref.word("rho"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.READ_IF_PRESENT, ref.IOobject.AUTO_WRITE),
        man.volScalarField(pThermo.rho(), man.Deps(pThermo)))

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField(
        man.IOobject(ref.word("U"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)

    phi = man.compressibleCreatePhi(runTime, mesh, U, rho)

    rhoMax = ref.dimensionedScalar(pimple.dict().lookup(ref.word("rhoMax")))
    rhoMin = ref.dimensionedScalar(pimple.dict().lookup(ref.word("rhoMin")))

    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.turbulenceModel.New(rho, U, phi, pThermo)

    ref.ext_Info() << "Creating field dpdt\n" << ref.nl
    dpdt = man.volScalarField(ref.word("dpdt"), man.fvc.ddt(p))

    ref.ext_Info() << "Creating field kinetic energy K\n" << ref.nl
    K = man.volScalarField(ref.word("K"),
                           man.volScalarField(0.5 * U.magSqr(), man.Deps(U)))

    return pThermo, p, h, psi, rho, U, phi, rhoMax, rhoMin, turbulence, dpdt, K
Esempio n. 2
0
def createFields(runTime, mesh):

    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl

    pThermo = man.basicPsiThermo.New(mesh)

    p = man.volScalarField(pThermo.p(), man.Deps(pThermo))
    e = man.volScalarField(pThermo.e(), man.Deps(pThermo))
    psi = man.volScalarField(pThermo.psi(), man.Deps(pThermo))

    rho = man.volScalarField(
        man.IOobject(ref.word("rho"), ref.fileName(runTime.timeName()), mesh),
        man.volScalarField(pThermo.rho(), man.Deps(pThermo)))

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField(
        man.IOobject(ref.word("U"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)

    phi = man.compressibleCreatePhi(runTime, mesh, rho, U)

    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.turbulenceModel.New(rho, U, phi, pThermo)

    return pThermo, p, e, psi, rho, U, phi, turbulence
Esempio n. 3
0
def createFields( runTime, mesh):
    
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl
  
    pThermo = man.basicPsiThermo.New( mesh )
  
    p = man.volScalarField( pThermo.p(), man.Deps( pThermo ) )
    e = man.volScalarField( pThermo.e(), man.Deps( pThermo ) )
    psi = man.volScalarField( pThermo.psi(), man.Deps( pThermo ) )

    rho = man.volScalarField( man.IOobject( ref.word( "rho" ),
                                            ref.fileName( runTime.timeName() ),
                                            mesh ),
                              man.volScalarField( pThermo.rho(), man.Deps( pThermo ) ) )

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField( man.IOobject( ref.word( "U" ),
                                          ref.fileName( runTime.timeName() ),
                                          mesh,
                                          ref.IOobject.MUST_READ,
                                          ref.IOobject.AUTO_WRITE ), mesh );

    phi = man.compressibleCreatePhi( runTime, mesh, rho, U )
 
    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.turbulenceModel.New( rho, U, phi, pThermo )
    
    return pThermo, p, e, psi, rho, U, phi, turbulence
Esempio n. 4
0
def createFields( runTime, mesh, rhoO, psi ):
    ref.ext_Info()<< "Reading field p\n" << ref.nl
    p = man.volScalarField( man.IOobject( ref.word( "p" ),
                                          ref.fileName( runTime.timeName() ),
                                          mesh,
                                          ref.IOobject.MUST_READ,
                                          ref.IOobject.AUTO_WRITE ),
                            mesh )


    ref.ext_Info()<< "Reading field U\n" << ref.nl
    U = man.volVectorField( man.IOobject( ref.word( "U" ),
                                          ref.fileName( runTime.timeName() ),
                                          mesh,
                                          ref.IOobject.MUST_READ,
                                          ref.IOobject.AUTO_WRITE ),
                            mesh )
    
    rho = man.volScalarField( man.IOobject( ref.word( "rho" ),
                                            ref.fileName( runTime.timeName() ),
                                            mesh,
                                            ref.IOobject.NO_READ,
                                            ref.IOobject.AUTO_WRITE ),
                              rhoO + psi * p )
  
    phi = man.compressibleCreatePhi( runTime, mesh, U, rho )
  
    return p, U, rho, phi
def createFields( runTime, mesh, g ):
    
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl
    
    pThermo = man.basicPsiThermo.New( mesh );

    rho = man.volScalarField( man.IOobject( ref.word( "rho" ), 
                                            ref.fileName( runTime.timeName() ),
                                            mesh, 
                                            ref.IOobject.NO_READ, 
                                            ref.IOobject.NO_WRITE ),
                              man( pThermo.rho(), man.Deps( pThermo ) ) );
    
    p = man( pThermo.p(), man.Deps( pThermo ) )
    h = man( pThermo.h(), man.Deps( pThermo ) )
    psi = man( pThermo.psi(), man.Deps( pThermo ) )
    
    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField( man.IOobject( ref.word( "U" ),
                                          ref.fileName( runTime.timeName() ),
                                          mesh,
                                          ref.IOobject.MUST_READ,
                                          ref.IOobject.AUTO_WRITE ),
                              mesh )
    
    phi = man.compressibleCreatePhi( runTime, mesh, rho, U );

    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.RASModel.New( rho, U,  phi, pThermo );

    ref.ext_Info()<< "Calculating field g.h\n" << ref.nl
    
    gh = man.volScalarField( ref.word( "gh" ), man( g & mesh.C(), man.Deps( mesh ) ) )
    ghf = man.surfaceScalarField( ref.word( "ghf" ), man( g & mesh.Cf(), man.Deps( mesh ) ) )
    
    ref.ext_Info() << "Reading field p_rgh\n" << ref.nl
    p_rgh = man.volScalarField( man.IOobject( ref.word( "p_rgh" ),
                                              ref.fileName( runTime.timeName() ),
                                              mesh,
                                              ref.IOobject.MUST_READ,
                                              ref.IOobject.AUTO_WRITE ),
                                mesh );
    # Force p_rgh to be consistent with p
    p_rgh << p - rho * gh
    
    pRefCell = 0
    pRefValue = 0.0
    
    pRefCell, pRefValue = ref.setRefCell( p, p_rgh, mesh.solutionDict().subDict( ref.word( "SIMPLE" ) ), pRefCell, pRefValue );

    initialMass = ref.fvc.domainIntegrate( rho )
    totalVolume = mesh.V().ext_sum()
    
    return pThermo, rho, p, h, psi, U, phi, turbulence, gh, ghf, p_rgh, pRefCell, pRefValue, initialMass, totalVolume
Esempio n. 6
0
def createFields(runTime, mesh, g):
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl

    pThermo = man.basicRhoThermo.New(mesh)

    rho = man.volScalarField(
        man.IOobject(
            ref.word("rho"), ref.fileName(runTime.timeName()), mesh, ref.IOobject.NO_READ, ref.IOobject.NO_WRITE
        ),
        man.volScalarField(pThermo.rho(), man.Deps(pThermo)),
    )

    p = man.volScalarField(pThermo.p(), man.Deps(pThermo))
    h = man.volScalarField(pThermo.h(), man.Deps(pThermo))
    psi = man.volScalarField(pThermo.psi(), man.Deps(pThermo))

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField(
        man.IOobject(
            ref.word("U"), ref.fileName(runTime.timeName()), mesh, ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE
        ),
        mesh,
    )

    phi = man.compressibleCreatePhi(runTime, mesh, U, rho)

    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.turbulenceModel.New(rho, U, phi, pThermo)

    ref.ext_Info() << "Calculating field g.h\n" << ref.nl
    gh = man.volScalarField(ref.word("gh"), man.volScalarField(g & mesh.C(), man.Deps(mesh)))
    ghf = man.surfaceScalarField(ref.word("ghf"), man.surfaceScalarField(g & mesh.Cf(), man.Deps(mesh)))

    ref.ext_Info() << "Reading field p_rgh\n" << ref.nl
    p_rgh = man.volScalarField(
        man.IOobject(
            ref.word("p_rgh"), ref.fileName(runTime.timeName()), mesh, ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE
        ),
        mesh,
    )

    # Force p_rgh to be consistent with p
    p_rgh << p - rho * gh

    ref.ext_Info() << "Creating field DpDt\n" << ref.nl

    DpDt = man.volScalarField(
        ref.word("DpDt"), man.fvc.DDt(man.surfaceScalarField(ref.word("phiU"), phi / man.fvc.interpolate(rho)), p)
    )

    return pThermo, p, rho, h, psi, U, phi, turbulence, gh, ghf, p_rgh, DpDt
def createFields(runTime, mesh, g):

    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl

    pThermo = man.basicPsiThermo.New(mesh)

    rho = man.volScalarField(
        man.IOobject(ref.word("rho"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.NO_READ, ref.IOobject.NO_WRITE),
        man(pThermo.rho(), man.Deps(pThermo)))

    p = man(pThermo.p(), man.Deps(pThermo))
    h = man(pThermo.h(), man.Deps(pThermo))
    psi = man(pThermo.psi(), man.Deps(pThermo))

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField(
        man.IOobject(ref.word("U"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)

    phi = man.compressibleCreatePhi(runTime, mesh, rho, U)

    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.RASModel.New(rho, U, phi, pThermo)

    ref.ext_Info() << "Calculating field g.h\n" << ref.nl

    gh = man.volScalarField(ref.word("gh"), man(g & mesh.C(), man.Deps(mesh)))
    ghf = man.surfaceScalarField(ref.word("ghf"),
                                 man(g & mesh.Cf(), man.Deps(mesh)))

    ref.ext_Info() << "Reading field p_rgh\n" << ref.nl
    p_rgh = man.volScalarField(
        man.IOobject(ref.word("p_rgh"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)
    # Force p_rgh to be consistent with p
    p_rgh << p - rho * gh

    pRefCell = 0
    pRefValue = 0.0

    pRefCell, pRefValue = ref.setRefCell(
        p, p_rgh,
        mesh.solutionDict().subDict(ref.word("SIMPLE")), pRefCell, pRefValue)

    initialMass = ref.fvc.domainIntegrate(rho)
    totalVolume = mesh.V().ext_sum()

    return pThermo, rho, p, h, psi, U, phi, turbulence, gh, ghf, p_rgh, pRefCell, pRefValue, initialMass, totalVolume
Esempio n. 8
0
def createFields(runTime, mesh, g):
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl

    pThermo = man.basicRhoThermo.New(mesh)

    rho = man.volScalarField(
        man.IOobject(ref.word("rho"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.NO_READ, ref.IOobject.NO_WRITE),
        man.volScalarField(pThermo.rho(), man.Deps(pThermo)))

    p = man.volScalarField(pThermo.p(), man.Deps(pThermo))
    h = man.volScalarField(pThermo.h(), man.Deps(pThermo))
    psi = man.volScalarField(pThermo.psi(), man.Deps(pThermo))

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField(
        man.IOobject(ref.word("U"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)

    phi = man.compressibleCreatePhi(runTime, mesh, U, rho)

    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.turbulenceModel.New(rho, U, phi, pThermo)

    ref.ext_Info() << "Calculating field g.h\n" << ref.nl
    gh = man.volScalarField(ref.word("gh"),
                            man.volScalarField(g & mesh.C(), man.Deps(mesh)))
    ghf = man.surfaceScalarField(
        ref.word("ghf"), man.surfaceScalarField(g & mesh.Cf(), man.Deps(mesh)))

    ref.ext_Info() << "Reading field p_rgh\n" << ref.nl
    p_rgh = man.volScalarField(
        man.IOobject(ref.word("p_rgh"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)

    # Force p_rgh to be consistent with p
    p_rgh << p - rho * gh

    ref.ext_Info() << "Creating field DpDt\n" << ref.nl

    DpDt = man.volScalarField(
        ref.word("DpDt"),
        man.fvc.DDt(
            man.surfaceScalarField(ref.word("phiU"),
                                   phi / man.fvc.interpolate(rho)), p))

    return pThermo, p, rho, h, psi, U, phi, turbulence, gh, ghf, p_rgh, DpDt
def _createFields( runTime, mesh, simple ):
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl
    
    thermo = man.basicPsiThermo.New( mesh )

    rho = man.volScalarField( man.IOobject( ref.word( "rho" ),
                                            ref.fileName( runTime.timeName() ),
                                            mesh,
                                            ref.IOobject.READ_IF_PRESENT,
                                            ref.IOobject.AUTO_WRITE ),
                              man.volScalarField( thermo.rho(), man.Deps( thermo ) ) )

    p = man.volScalarField( thermo.p(), man.Deps( thermo ) )
    h = man.volScalarField( thermo.h(), man.Deps( thermo ) )
    psi = man.volScalarField( thermo.psi(), man.Deps( thermo ) )
   
    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField( man.IOobject( ref.word( "U" ),
                                          ref.fileName( runTime.timeName() ),
                                          mesh,
                                          ref.IOobject.MUST_READ,
                                          ref.IOobject.AUTO_WRITE ),
                            mesh )

    phi = man.compressibleCreatePhi( runTime, mesh, rho, U )
    
    pRefCell = 0
    pRefValue = 0.0
    
    pRefCell, pRefValue = ref.setRefCell( p, simple.dict(), pRefCell, pRefValue )
    
    rhoMax = ref.dimensionedScalar( simple.dict().lookup( ref.word( "rhoMax" ) ) )
    rhoMin = ref.dimensionedScalar( simple.dict().lookup( ref.word( "rhoMin" ) ) )
    
    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.RASModel.New( rho,
                                                U,
                                                phi,
                                                thermo )
    
    initialMass = ref.fvc.domainIntegrate( rho )
    
    return thermo, rho, p, h, psi, U, phi, pRefCell, pRefValue, turbulence, initialMass, rhoMax, rhoMin
Esempio n. 10
0
def createFields(runTime, mesh, rhoO, psi):
    ref.ext_Info() << "Reading field p\n" << ref.nl
    p = man.volScalarField(
        man.IOobject(ref.word("p"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField(
        man.IOobject(ref.word("U"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE), mesh)

    rho = man.volScalarField(
        man.IOobject(ref.word("rho"), ref.fileName(runTime.timeName()), mesh,
                     ref.IOobject.NO_READ, ref.IOobject.AUTO_WRITE),
        rhoO + psi * p)

    phi = man.compressibleCreatePhi(runTime, mesh, U, rho)

    return p, U, rho, phi
Esempio n. 11
0
def _createFields( runTime, mesh, simple ):
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl
    
    thermo = man.basicPsiThermo.New( mesh )

    rho = man.volScalarField( man.IOobject( ref.word( "rho" ),
                                            ref.fileName( runTime.timeName() ),
                                            mesh,
                                            ref.IOobject.READ_IF_PRESENT,
                                            ref.IOobject.AUTO_WRITE ),
                              man.volScalarField( thermo.rho(), man.Deps( thermo ) ) )

    p = man.volScalarField( thermo.p(), man.Deps( thermo ) )
    h = man.volScalarField( thermo.h(), man.Deps( thermo ) )
    psi = man.volScalarField( thermo.psi(), man.Deps( thermo ) )
   
    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField( man.IOobject( ref.word( "U" ),
                                          ref.fileName( runTime.timeName() ),
                                          mesh,
                                          ref.IOobject.MUST_READ,
                                          ref.IOobject.AUTO_WRITE ),
                            mesh )

    phi = man.compressibleCreatePhi( runTime, mesh, rho, U )
    
    pRefCell = 0
    pRefValue = 0.0
    
    pRefCell, pRefValue = ref.setRefCell( p, simple.dict(), pRefCell, pRefValue )
    
    rhoMax = ref.dimensionedScalar( simple.dict().lookup( ref.word( "rhoMax" ) ) )
    rhoMin = ref.dimensionedScalar( simple.dict().lookup( ref.word( "rhoMin" ) ) )
    
    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.RASModel.New( rho,
                                                U,
                                                phi,
                                                thermo )
    
    initialMass = ref.fvc.domainIntegrate( rho )
    
    return thermo, rho, p, h, psi, U, phi, pRefCell, pRefValue, turbulence, initialMass, rhoMax, rhoMin
Esempio n. 12
0
def createFields(runTime, mesh, pimple):
    ref.ext_Info() << "Reading thermophysical properties\n" << ref.nl

    pThermo = man.basicPsiThermo.New(mesh)

    p = man.volScalarField(pThermo.p(), man.Deps(pThermo))
    h = man.volScalarField(pThermo.h(), man.Deps(pThermo))
    psi = man.volScalarField(pThermo.psi(), man.Deps(pThermo))

    rho = man.volScalarField(
        man.IOobject(
            ref.word("rho"),
            ref.fileName(runTime.timeName()),
            mesh,
            ref.IOobject.READ_IF_PRESENT,
            ref.IOobject.AUTO_WRITE,
        ),
        man.volScalarField(pThermo.rho(), man.Deps(pThermo)),
    )

    ref.ext_Info() << "Reading field U\n" << ref.nl
    U = man.volVectorField(
        man.IOobject(
            ref.word("U"), ref.fileName(runTime.timeName()), mesh, ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE
        ),
        mesh,
    )

    phi = man.compressibleCreatePhi(runTime, mesh, U, rho)

    rhoMax = ref.dimensionedScalar(pimple.dict().lookup(ref.word("rhoMax")))
    rhoMin = ref.dimensionedScalar(pimple.dict().lookup(ref.word("rhoMin")))

    ref.ext_Info() << "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.turbulenceModel.New(rho, U, phi, pThermo)

    ref.ext_Info() << "Creating field dpdt\n" << ref.nl
    dpdt = man.volScalarField(ref.word("dpdt"), man.fvc.ddt(p))

    ref.ext_Info() << "Creating field kinetic energy K\n" << ref.nl
    K = man.volScalarField(ref.word("K"), man.volScalarField(0.5 * U.magSqr(), man.Deps(U)))

    return pThermo, p, h, psi, rho, U, phi, rhoMax, rhoMin, turbulence, dpdt, K
Esempio n. 13
0
def createFields( runTime, mesh ):
    ref.ext_Info()<< "Reading thermophysical properties\n" << ref.nl
    
    pThermo = man.basicPsiThermo.New( mesh )
    
    p = man.volScalarField( pThermo.p(), man.Deps( pThermo ) )
    h = man.volScalarField( pThermo.h(), man.Deps( pThermo ) )
    psi = man.volScalarField( pThermo.psi(), man.Deps( pThermo ) )
    
    rho = man.volScalarField( man.IOobject( ref.word( "rho" ),
                                            ref.fileName( runTime.timeName() ),
                                            mesh,
                                            ref.IOobject.READ_IF_PRESENT,
                                            ref.IOobject.AUTO_WRITE ),
                              man.volScalarField( pThermo.rho(), man.Deps( pThermo ) ) )
    
    ref.ext_Info()<< "Reading field U\n" << ref.nl
    U = man.volVectorField( man.IOobject( ref.word( "U" ),
                                          ref.fileName( runTime.timeName() ),
                                          mesh,
                                          ref.IOobject.MUST_READ,
                                          ref.IOobject.AUTO_WRITE ),
                            mesh )

    phi = man.compressibleCreatePhi( runTime, mesh, U, rho )

    rhoMax = ref.dimensionedScalar( mesh.solutionDict().subDict( ref.word( "PIMPLE" ) ).lookup( ref.word( "rhoMax" ) ) )
    rhoMin = ref.dimensionedScalar( mesh.solutionDict().subDict( ref.word( "PIMPLE" ) ).lookup( ref.word( "rhoMin" ) ) )

    ref.ext_Info()<< "Creating turbulence model\n" << ref.nl
    turbulence = man.compressible.turbulenceModel.New( rho, U, phi, pThermo );
  
    ref.ext_Info()<< "Creating field DpDt\n" << ref.nl;
    DpDt = man.fvc.DDt( man.surfaceScalarField( ref.word( "phiU" ), phi / man.fvc.interpolate( rho ) ), p )
  
    return pThermo, p, h, psi, rho, U, phi, rhoMax, rhoMin, turbulence, DpDt