def createPhia(runTime, mesh, Ua): ref.ext_Info() << "Reading/calculating face flux field phia\n" << ref.nl phia = man.surfaceScalarField( man.IOobject(ref.word("phia"), ref.fileName(runTime.timeName()), mesh, ref.IOobject.READ_IF_PRESENT, ref.IOobject.AUTO_WRITE), man.surfaceScalarField( ref.linearInterpolate(Ua) & mesh.Sf(), man.Deps(Ua, mesh))) return phia
def _createFields( runTime, mesh ): 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 Urel\n" << ref.nl Urel = man.volVectorField( man.IOobject( ref.word( "Urel" ), ref.fileName( runTime.timeName() ), mesh, ref.IOobject.MUST_READ, ref.IOobject.AUTO_WRITE ), mesh ) ref.ext_Info() << "Reading/calculating face flux field phi\n" << ref.nl phi = man.surfaceScalarField( man.IOobject( ref.word( "phi" ), ref.fileName( runTime.timeName() ), mesh, ref.IOobject.READ_IF_PRESENT, ref.IOobject.AUTO_WRITE ), man.surfaceScalarField( ref.linearInterpolate( Urel ) & mesh.Sf(), man.Deps( mesh, Urel ) ) ) pRefCell = 0 pRefValue = 0.0 pRefCell, pRefValue = ref.setRefCell( p, mesh.solutionDict().subDict( ref.word( "PIMPLE" ) ), pRefCell, pRefValue ) laminarTransport = man.singlePhaseTransportModel( Urel, phi ) turbulence = man.incompressible.turbulenceModel.New( Urel, phi, laminarTransport ) ref.ext_Info() << "Creating SRF model\n" << ref.nl SRF = man.SRF.SRFModel.New( Urel ) sources = man.IObasicSourceList( mesh ) # Create the absolute velocity U = man.volVectorField( man.IOobject( ref.word( "U" ), ref.fileName( runTime.timeName() ), mesh, ref.IOobject.NO_READ, ref.IOobject.AUTO_WRITE ), man.volVectorField( Urel() + SRF.U(), man.Deps( Urel, SRF ) ) ) # mixed calculations return p, U, Urel, SRF, phi, turbulence, pRefCell, pRefValue, laminarTransport, sources
def createPhia(runTime, mesh, Ua): ref.ext_Info() << "Reading/calculating face flux field phia\n" << ref.nl phia = man.surfaceScalarField( man.IOobject( ref.word("phia"), ref.fileName(runTime.timeName()), mesh, ref.IOobject.READ_IF_PRESENT, ref.IOobject.AUTO_WRITE, ), man.surfaceScalarField(ref.linearInterpolate(Ua) & mesh.Sf(), man.Deps(Ua, mesh)), ) return phia