fluxRequired: Added setFluxRequired function to fvSchemes class

Added calls to setFluxRequired for p, p_rgh etc. in all solvers which
avoids the need to add fluxRequired entries in fvSchemes dictionaries.
This commit is contained in:
Henry Weller
2015-07-15 21:57:16 +01:00
parent 15198a34bd
commit 0fb6a01280
208 changed files with 3643 additions and 4591 deletions

View File

@ -1,6 +1,6 @@
Info<< "Reading field p\n" << endl; Info<< "Reading field p\n" << endl;
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,6 +24,8 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
mesh.setFluxRequired(p.name());

View File

@ -1,16 +1,16 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiuReactionThermo> pThermo autoPtr<psiuReactionThermo> pThermo
( (
psiuReactionThermo::New(mesh) psiuReactionThermo::New(mesh)
); );
psiuReactionThermo& thermo = pThermo(); psiuReactionThermo& thermo = pThermo();
thermo.validate(args.executable(), "ha", "ea"); thermo.validate(args.executable(), "ha", "ea");
basicMultiComponentMixture& composition = thermo.composition(); basicMultiComponentMixture& composition = thermo.composition();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -20,17 +20,17 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField& b = composition.Y("b"); volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl; Info<< "min(b) = " << min(b).value() << endl;
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -40,13 +40,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl; mesh.setFluxRequired(p.name());
autoPtr<compressible::RASModel> turbulence
( Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::RASModel::New compressible::RASModel::New
( (
rho, rho,
@ -54,12 +56,12 @@
phi, phi,
thermo thermo
) )
); );
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -68,22 +70,22 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
Info<< "Creating the unstrained laminar flame speed\n" << endl; Info<< "Creating the unstrained laminar flame speed\n" << endl;
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
( (
laminarFlameSpeed::New(thermo) laminarFlameSpeed::New(thermo)
); );
Info<< "Reading strained laminar flame speed field Su\n" << endl; Info<< "Reading strained laminar flame speed field Su\n" << endl;
volScalarField Su volScalarField Su
( (
IOobject IOobject
( (
"Su", "Su",
@ -93,11 +95,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field betav\n" << endl; Info<< "Reading field betav\n" << endl;
volScalarField betav volScalarField betav
( (
IOobject IOobject
( (
"betav", "betav",
@ -107,11 +109,11 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field Lobs\n" << endl; Info<< "Reading field Lobs\n" << endl;
volScalarField Lobs volScalarField Lobs
( (
IOobject IOobject
( (
"Lobs", "Lobs",
@ -121,11 +123,11 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field CT\n" << endl; Info<< "Reading field CT\n" << endl;
volSymmTensorField CT volSymmTensorField CT
( (
IOobject IOobject
( (
"CT", "CT",
@ -135,11 +137,11 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field Nv\n" << endl; Info<< "Reading field Nv\n" << endl;
volScalarField Nv volScalarField Nv
( (
IOobject IOobject
( (
"Nv", "Nv",
@ -149,11 +151,11 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field nsv\n" << endl; Info<< "Reading field nsv\n" << endl;
volSymmTensorField nsv volSymmTensorField nsv
( (
IOobject IOobject
( (
"nsv", "nsv",
@ -163,10 +165,10 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh mesh
); );
IOdictionary PDRProperties IOdictionary PDRProperties
( (
IOobject IOobject
( (
"PDRProperties", "PDRProperties",
@ -175,21 +177,21 @@
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
); );
//- Create the drag model //- Create the drag model
autoPtr<PDRDragModel> drag = PDRDragModel::New autoPtr<PDRDragModel> drag = PDRDragModel::New
( (
PDRProperties, PDRProperties,
turbulence, turbulence,
rho, rho,
U, U,
phi phi
); );
//- Create the flame-wrinkling model //- Create the flame-wrinkling model
autoPtr<XiModel> flameWrinkling = XiModel::New autoPtr<XiModel> flameWrinkling = XiModel::New
( (
PDRProperties, PDRProperties,
thermo, thermo,
turbulence, turbulence,
@ -197,11 +199,11 @@
rho, rho,
b, b,
phi phi
); );
Info<< "Calculating turbulent flame speed field St\n" << endl; Info<< "Calculating turbulent flame speed field St\n" << endl;
volScalarField St volScalarField St
( (
IOobject IOobject
( (
"St", "St",
@ -211,17 +213,17 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
flameWrinkling->Xi()*Su flameWrinkling->Xi()*Su
); );
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft")) if (composition.contains("ft"))
{ {
fields.add(composition.Y("ft")); fields.add(composition.Y("ft"));
} }
fields.add(b); fields.add(b);
fields.add(thermo.he()); fields.add(thermo.he());
fields.add(thermo.heu()); fields.add(thermo.heu());
flameWrinkling->addXi(fields); flameWrinkling->addXi(fields);

View File

@ -1,16 +1,16 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiuReactionThermo> pThermo autoPtr<psiuReactionThermo> pThermo
( (
psiuReactionThermo::New(mesh) psiuReactionThermo::New(mesh)
); );
psiuReactionThermo& thermo = pThermo(); psiuReactionThermo& thermo = pThermo();
thermo.validate(args.executable(), "ha", "ea"); thermo.validate(args.executable(), "ha", "ea");
basicMultiComponentMixture& composition = thermo.composition(); basicMultiComponentMixture& composition = thermo.composition();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -20,18 +20,18 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField& b = composition.Y("b"); volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl; Info<< "min(b) = " << min(b).value() << endl;
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -41,14 +41,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -56,11 +57,11 @@
phi, phi,
thermo thermo
) )
); );
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -69,14 +70,14 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
Info<< "Creating field Xi\n" << endl; Info<< "Creating field Xi\n" << endl;
volScalarField Xi volScalarField Xi
( (
IOobject IOobject
( (
"Xi", "Xi",
@ -86,19 +87,19 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Creating the unstrained laminar flame speed\n" << endl; Info<< "Creating the unstrained laminar flame speed\n" << endl;
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
( (
laminarFlameSpeed::New(thermo) laminarFlameSpeed::New(thermo)
); );
Info<< "Reading strained laminar flame speed field Su\n" << endl; Info<< "Reading strained laminar flame speed field Su\n" << endl;
volScalarField Su volScalarField Su
( (
IOobject IOobject
( (
"Su", "Su",
@ -108,14 +109,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
dimensionedScalar SuMin = 0.01*Su.average(); dimensionedScalar SuMin = 0.01*Su.average();
dimensionedScalar SuMax = 4*Su.average(); dimensionedScalar SuMax = 4*Su.average();
Info<< "Calculating turbulent flame speed field St\n" << endl; Info<< "Calculating turbulent flame speed field St\n" << endl;
volScalarField St volScalarField St
( (
IOobject IOobject
( (
"St", "St",
@ -125,16 +126,16 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
Xi*Su Xi*Su
); );
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft")) if (composition.contains("ft"))
{ {
fields.add(composition.Y("ft")); fields.add(composition.Y("ft"));
} }
fields.add(b); fields.add(b);
fields.add(thermo.he()); fields.add(thermo.he());
fields.add(thermo.heu()); fields.add(thermo.heu());

View File

@ -1,28 +1,28 @@
Info<< "Creating combustion model\n" << endl; Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> combustion autoPtr<combustionModels::psiCombustionModel> combustion
( (
combustionModels::psiCombustionModel::New combustionModels::psiCombustionModel::New
( (
mesh mesh
) )
); );
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
psiReactionThermo& thermo = combustion->thermo(); psiReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicMultiComponentMixture& composition = thermo.composition(); basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));
Info<< "Creating field rho\n" << endl; Info<< "Creating field rho\n" << endl;
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -32,15 +32,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -50,13 +50,13 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -64,13 +64,13 @@
phi, phi,
thermo thermo
) )
); );
// Set the turbulence into the combustion model // Set the turbulence into the combustion model
combustion->setTurbulence(turbulence()); combustion->setTurbulence(turbulence());
volScalarField dQ volScalarField dQ
( (
IOobject IOobject
( (
"dQ", "dQ",
@ -81,12 +81,12 @@
), ),
mesh, mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
); );
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -95,19 +95,19 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -117,21 +117,23 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; mesh.setFluxRequired(p_rgh.name());
forAll(Y, i) multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
{
forAll(Y, i)
{
fields.add(Y[i]); fields.add(Y[i]);
} }
fields.add(thermo.he()); fields.add(thermo.he());
IOdictionary additionalControlsDict IOdictionary additionalControlsDict
( (
IOobject IOobject
( (
"additionalControls", "additionalControls",
@ -140,9 +142,9 @@
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
); );
Switch solvePrimaryRegion Switch solvePrimaryRegion
( (
additionalControlsDict.lookup("solvePrimaryRegion") additionalControlsDict.lookup("solvePrimaryRegion")
); );

View File

@ -45,6 +45,8 @@ const volScalarField& T = thermo.T();
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
Info << "Creating turbulence model.\n" << nl; Info << "Creating turbulence model.\n" << nl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (

View File

@ -46,6 +46,7 @@ const volScalarField& T = thermo.T();
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
Info << "Creating turbulence model.\n" << nl; Info << "Creating turbulence model.\n" << nl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence

View File

@ -43,9 +43,10 @@ volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
Info << "Creating turbulence model.\n" << nl; Info << "Creating turbulence model.\n" << nl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence

View File

@ -1,17 +1,17 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiThermo> pThermo autoPtr<psiThermo> pThermo
( (
psiThermo::New(mesh) psiThermo::New(mesh)
); );
psiThermo& thermo = pThermo(); psiThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -21,11 +21,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -35,12 +35,12 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
dimensionedScalar rhoMax dimensionedScalar rhoMax
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMax", "rhoMax",
@ -48,10 +48,10 @@
GREAT, GREAT,
dimDensity dimDensity
) )
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMin", "rhoMin",
@ -59,11 +59,11 @@
0, 0,
dimDensity dimDensity
) )
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -71,11 +71,13 @@
phi, phi,
thermo thermo
) )
); );
Info<< "Creating field dpdt\n" << endl; mesh.setFluxRequired(p.name());
volScalarField dpdt
( Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject IOobject
( (
"dpdt", "dpdt",
@ -84,7 +86,7 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));

View File

@ -1,14 +1,14 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiThermo> pThermo autoPtr<psiThermo> pThermo
( (
psiThermo::New(mesh) psiThermo::New(mesh)
); );
psiThermo& thermo = pThermo(); psiThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -18,14 +18,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -35,17 +35,19 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, simple.dict(), pRefCell, pRefValue); setRefCell(p, simple.dict(), pRefCell, pRefValue);
dimensionedScalar rhoMax mesh.setFluxRequired(p.name());
(
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMax", "rhoMax",
@ -53,10 +55,10 @@
GREAT, GREAT,
dimDensity dimDensity
) )
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMin", "rhoMin",
@ -64,11 +66,11 @@
0, 0,
dimDensity dimDensity
) )
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence autoPtr<compressible::RASModel> turbulence
( (
compressible::RASModel::New compressible::RASModel::New
( (
rho, rho,
@ -76,6 +78,6 @@
phi, phi,
thermo thermo
) )
); );
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -1,14 +1,14 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoThermo> pThermo autoPtr<rhoThermo> pThermo
( (
rhoThermo::New(mesh) rhoThermo::New(mesh)
); );
rhoThermo& thermo = pThermo(); rhoThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -18,13 +18,13 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -34,17 +34,19 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, simple.dict(), pRefCell, pRefValue); setRefCell(p, simple.dict(), pRefCell, pRefValue);
dimensionedScalar rhoMax mesh.setFluxRequired(p.name());
(
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMax", "rhoMax",
@ -52,10 +54,10 @@
GREAT, GREAT,
dimDensity dimDensity
) )
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMin", "rhoMin",
@ -63,11 +65,11 @@
0, 0,
dimDensity dimDensity
) )
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence autoPtr<compressible::RASModel> turbulence
( (
compressible::RASModel::New compressible::RASModel::New
( (
rho, rho,
@ -75,6 +77,6 @@
phi, phi,
thermo thermo
) )
); );
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -1,18 +1,18 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiThermo> pThermo autoPtr<psiThermo> pThermo
( (
psiThermo::New(mesh) psiThermo::New(mesh)
); );
psiThermo& thermo = pThermo(); psiThermo& thermo = pThermo();
thermo.validate(args.executable(), "e"); thermo.validate(args.executable(), "e");
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
volScalarField& e = thermo.he(); volScalarField& e = thermo.he();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -20,11 +20,11 @@
mesh mesh
), ),
thermo.rho() thermo.rho()
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -34,14 +34,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -49,7 +50,7 @@
phi, phi,
thermo thermo
) )
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));

View File

@ -1,6 +1,6 @@
Info<< "Reading field p\n" << endl; Info<< "Reading field p\n" << endl;
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -10,12 +10,12 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -25,10 +25,10 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -38,7 +38,9 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
rhoO + psi*p rhoO + psi*p
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());

View File

@ -1,7 +1,7 @@
Info<< "Reading transportProperties\n" << endl; Info<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties IOdictionary transportProperties
( (
IOobject IOobject
( (
"transportProperties", "transportProperties",
@ -10,31 +10,31 @@
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
); );
dimensionedScalar rho dimensionedScalar rho
( (
transportProperties.lookup("rho") transportProperties.lookup("rho")
); );
dimensionedScalar nu dimensionedScalar nu
( (
transportProperties.lookup("nu") transportProperties.lookup("nu")
); );
dimensionedScalar mu dimensionedScalar mu
( (
transportProperties.lookup("mu") transportProperties.lookup("mu")
); );
dimensionedScalar sigma dimensionedScalar sigma
( (
transportProperties.lookup("sigma") transportProperties.lookup("sigma")
); );
Info<< "Reading field p\n" << endl; Info<< "Reading field p\n" << endl;
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -44,12 +44,12 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -59,13 +59,13 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
Info<< "Reading field pB\n" << endl; Info<< "Reading field pB\n" << endl;
volScalarField pB volScalarField pB
( (
IOobject IOobject
( (
"pB", "pB",
@ -75,12 +75,12 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field B\n" << endl; Info<< "Reading field B\n" << endl;
volVectorField B volVectorField B
( (
IOobject IOobject
( (
"B", "B",
@ -90,18 +90,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhiB.H" #include "createPhiB.H"
dimensionedScalar DB = 1.0/(mu*sigma); dimensionedScalar DB = 1.0/(mu*sigma);
DB.name() = "DB"; DB.name() = "DB";
dimensionedScalar DBU = 1.0/(2.0*mu*rho); dimensionedScalar DBU = 1.0/(2.0*mu*rho);
DBU.name() = "DBU"; DBU.name() = "DBU";
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, piso.dict(), pRefCell, pRefValue); setRefCell(p, piso.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name());
mesh.setFluxRequired(pB.name());

View File

@ -1,8 +1,8 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
Info<< "Reading field T\n" << endl; Info<< "Reading field T\n" << endl;
volScalarField T volScalarField T
( (
IOobject IOobject
( (
"T", "T",
@ -12,11 +12,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -26,11 +26,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -40,21 +40,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
#include "readTransportProperties.H" #include "readTransportProperties.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::RASModel> turbulence autoPtr<incompressible::RASModel> turbulence
( (
incompressible::RASModel::New(U, phi, laminarTransport) incompressible::RASModel::New(U, phi, laminarTransport)
); );
// Kinematic density for buoyancy force // Kinematic density for buoyancy force
volScalarField rhok volScalarField rhok
( (
IOobject IOobject
( (
"rhok", "rhok",
@ -62,12 +62,12 @@
mesh mesh
), ),
1.0 - beta*(T - TRef) 1.0 - beta*(T - TRef)
); );
// kinematic turbulent thermal thermal conductivity m2/s // kinematic turbulent thermal thermal conductivity m2/s
Info<< "Reading field alphat\n" << endl; Info<< "Reading field alphat\n" << endl;
volScalarField alphat volScalarField alphat
( (
IOobject IOobject
( (
"alphat", "alphat",
@ -77,16 +77,16 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -96,25 +96,27 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rhok*gh p_rgh + rhok*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
p.dimensions(), p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
} }
mesh.setFluxRequired(p_rgh.name());

View File

@ -1,8 +1,8 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
Info<< "Reading field T\n" << endl; Info<< "Reading field T\n" << endl;
volScalarField T volScalarField T
( (
IOobject IOobject
( (
"T", "T",
@ -12,11 +12,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -26,11 +26,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -40,21 +40,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
#include "readTransportProperties.H" #include "readTransportProperties.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<incompressible::RASModel> turbulence autoPtr<incompressible::RASModel> turbulence
( (
incompressible::RASModel::New(U, phi, laminarTransport) incompressible::RASModel::New(U, phi, laminarTransport)
); );
// Kinematic density for buoyancy force // Kinematic density for buoyancy force
volScalarField rhok volScalarField rhok
( (
IOobject IOobject
( (
"rhok", "rhok",
@ -62,12 +62,12 @@
mesh mesh
), ),
1.0 - beta*(T - TRef) 1.0 - beta*(T - TRef)
); );
// kinematic turbulent thermal thermal conductivity m2/s // kinematic turbulent thermal thermal conductivity m2/s
Info<< "Reading field alphat\n" << endl; Info<< "Reading field alphat\n" << endl;
volScalarField alphat volScalarField alphat
( (
IOobject IOobject
( (
"alphat", "alphat",
@ -77,16 +77,16 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -96,25 +96,27 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rhok*gh p_rgh + rhok*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
simple.dict(), simple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
p.dimensions(), p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
} }
mesh.setFluxRequired(p_rgh.name());

View File

@ -1,11 +1,11 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh)); autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
rhoThermo& thermo = pThermo(); rhoThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -15,15 +15,15 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -33,14 +33,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -48,15 +48,15 @@
phi, phi,
thermo thermo
) )
); );
Info<< "Calculating field g.h\n" << endl; Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C()); volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf()); surfaceScalarField ghf("ghf", g & mesh.Cf());
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -66,14 +66,16 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
Info<< "Creating field dpdt\n" << endl; mesh.setFluxRequired(p_rgh.name());
volScalarField dpdt
( Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject IOobject
( (
"dpdt", "dpdt",
@ -82,7 +84,7 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));

View File

@ -1,11 +1,11 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh)); autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
rhoThermo& thermo = pThermo(); rhoThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -15,14 +15,14 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -32,13 +32,13 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence autoPtr<compressible::RASModel> turbulence
( (
compressible::RASModel::New compressible::RASModel::New
( (
rho, rho,
@ -46,16 +46,16 @@
phi, phi,
thermo thermo
) )
); );
Info<< "Calculating field g.h\n" << endl; Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C()); volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf()); surfaceScalarField ghf("ghf", g & mesh.Cf());
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -65,22 +65,23 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
label pRefCell = 0;
label pRefCell = 0; scalar pRefValue = 0.0;
scalar pRefValue = 0.0; setRefCell
setRefCell (
(
p, p,
p_rgh, p_rgh,
simple.dict(), simple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
dimensionedScalar initialMass = fvc::domainIntegrate(rho); mesh.setFluxRequired(p_rgh.name());
dimensionedScalar totalVolume = sum(mesh.V());
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
dimensionedScalar totalVolume = sum(mesh.V());

View File

@ -1,29 +1,29 @@
// Initialise fluid field pointer lists // Initialise fluid field pointer lists
PtrList<rhoThermo> thermoFluid(fluidRegions.size()); PtrList<rhoThermo> thermoFluid(fluidRegions.size());
PtrList<volScalarField> rhoFluid(fluidRegions.size()); PtrList<volScalarField> rhoFluid(fluidRegions.size());
PtrList<volVectorField> UFluid(fluidRegions.size()); PtrList<volVectorField> UFluid(fluidRegions.size());
PtrList<surfaceScalarField> phiFluid(fluidRegions.size()); PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size()); PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size()); PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
PtrList<volScalarField> p_rghFluid(fluidRegions.size()); PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size()); PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<radiation::radiationModel> radiation(fluidRegions.size()); PtrList<radiation::radiationModel> radiation(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
List<label> pRefCellFluid(fluidRegions.size(), 0); List<label> pRefCellFluid(fluidRegions.size(), 0);
List<scalar> pRefValueFluid(fluidRegions.size(), 0.0); List<scalar> pRefValueFluid(fluidRegions.size(), 0.0);
List<bool> frozenFlowFluid(fluidRegions.size(), false); List<bool> frozenFlowFluid(fluidRegions.size(), false);
PtrList<dimensionedScalar> rhoMax(fluidRegions.size()); PtrList<dimensionedScalar> rhoMax(fluidRegions.size());
PtrList<dimensionedScalar> rhoMin(fluidRegions.size()); PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size()); PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
PtrList<fv::IOoptionList> fluidFvOptions(fluidRegions.size()); PtrList<fv::IOoptionList> fluidFvOptions(fluidRegions.size());
// Populate fluid field pointer lists // Populate fluid field pointer lists
forAll(fluidRegions, i) forAll(fluidRegions, i)
{ {
Info<< "*** Reading fluid mesh thermophysical properties for region " Info<< "*** Reading fluid mesh thermophysical properties for region "
<< fluidRegions[i].name() << nl << endl; << fluidRegions[i].name() << nl << endl;
@ -154,6 +154,8 @@
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i]; p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
fluidRegions[i].setFluxRequired(p_rghFluid[i].name());
radiation.set radiation.set
( (
i, i,
@ -219,4 +221,4 @@
i, i,
new fv::IOoptionList(fluidRegions[i]) new fv::IOoptionList(fluidRegions[i])
); );
} }

View File

@ -1,26 +1,26 @@
// Initialise fluid field pointer lists // Initialise fluid field pointer lists
PtrList<rhoThermo> thermoFluid(fluidRegions.size()); PtrList<rhoThermo> thermoFluid(fluidRegions.size());
PtrList<volScalarField> rhoFluid(fluidRegions.size()); PtrList<volScalarField> rhoFluid(fluidRegions.size());
PtrList<volVectorField> UFluid(fluidRegions.size()); PtrList<volVectorField> UFluid(fluidRegions.size());
PtrList<surfaceScalarField> phiFluid(fluidRegions.size()); PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size()); PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size()); PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
PtrList<volScalarField> p_rghFluid(fluidRegions.size()); PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size()); PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<radiation::radiationModel> radiation(fluidRegions.size()); PtrList<radiation::radiationModel> radiation(fluidRegions.size());
PtrList<volScalarField> KFluid(fluidRegions.size()); PtrList<volScalarField> KFluid(fluidRegions.size());
PtrList<volScalarField> dpdtFluid(fluidRegions.size()); PtrList<volScalarField> dpdtFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
List<bool> frozenFlowFluid(fluidRegions.size(), false); List<bool> frozenFlowFluid(fluidRegions.size(), false);
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size()); PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
PtrList<fv::IOoptionList> fluidFvOptions(fluidRegions.size()); PtrList<fv::IOoptionList> fluidFvOptions(fluidRegions.size());
// Populate fluid field pointer lists // Populate fluid field pointer lists
forAll(fluidRegions, i) forAll(fluidRegions, i)
{ {
Info<< "*** Reading fluid mesh thermophysical properties for region " Info<< "*** Reading fluid mesh thermophysical properties for region "
<< fluidRegions[i].name() << nl << endl; << fluidRegions[i].name() << nl << endl;
@ -151,6 +151,8 @@
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i]; p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
fluidRegions[i].setFluxRequired(p_rghFluid[i].name());
radiation.set radiation.set
( (
i, i,
@ -209,4 +211,4 @@
i, i,
new fv::IOoptionList(fluidRegions[i]) new fv::IOoptionList(fluidRegions[i])
); );
} }

View File

@ -1,2 +0,0 @@
#include "../createFields.H"
mesh.setFluxRequired("pcorr");

View File

@ -1,5 +1,5 @@
word continuousPhaseName word continuousPhaseName
( (
IOdictionary IOdictionary
( (
IOobject IOobject
@ -10,11 +10,11 @@
IOobject::MUST_READ IOobject::MUST_READ
) )
).lookup("continuousPhaseName") ).lookup("continuousPhaseName")
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField Uc volVectorField Uc
( (
IOobject IOobject
( (
IOobject::groupName("U", continuousPhaseName), IOobject::groupName("U", continuousPhaseName),
@ -24,11 +24,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field p\n" << endl; Info<< "Reading field p\n" << endl;
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -38,14 +38,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading/calculating continuous-phase face flux field phic\n" Info<< "Reading/calculating continuous-phase face flux field phic\n"
<< endl; << endl;
surfaceScalarField phic surfaceScalarField phic
( (
IOobject IOobject
( (
IOobject::groupName("phi", continuousPhaseName), IOobject::groupName("phi", continuousPhaseName),
@ -55,28 +55,29 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
linearInterpolate(Uc) & mesh.Sf() linearInterpolate(Uc) & mesh.Sf()
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, pimple.dict(), pRefCell, pRefValue); setRefCell(p, pimple.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name());
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
singlePhaseTransportModel continuousPhaseTransport(Uc, phic); singlePhaseTransportModel continuousPhaseTransport(Uc, phic);
dimensionedScalar rhocValue dimensionedScalar rhocValue
( (
IOobject::groupName("rho", continuousPhaseName), IOobject::groupName("rho", continuousPhaseName),
dimDensity, dimDensity,
continuousPhaseTransport.lookup continuousPhaseTransport.lookup
( (
IOobject::groupName("rho", continuousPhaseName) IOobject::groupName("rho", continuousPhaseName)
) )
); );
volScalarField rhoc volScalarField rhoc
( (
IOobject IOobject
( (
rhocValue.name(), rhocValue.name(),
@ -87,10 +88,10 @@
), ),
mesh, mesh,
rhocValue rhocValue
); );
volScalarField muc volScalarField muc
( (
IOobject IOobject
( (
IOobject::groupName("mu", continuousPhaseName), IOobject::groupName("mu", continuousPhaseName),
@ -100,13 +101,13 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
rhoc*continuousPhaseTransport.nu() rhoc*continuousPhaseTransport.nu()
); );
Info << "Creating field alphac\n" << endl; Info << "Creating field alphac\n" << endl;
// alphac must be constructed before the cloud // alphac must be constructed before the cloud
// so that the drag-models can find it // so that the drag-models can find it
volScalarField alphac volScalarField alphac
( (
IOobject IOobject
( (
IOobject::groupName("alpha", continuousPhaseName), IOobject::groupName("alpha", continuousPhaseName),
@ -117,42 +118,42 @@
), ),
mesh, mesh,
dimensionedScalar("0", dimless, 0) dimensionedScalar("0", dimless, 0)
); );
word kinematicCloudName("kinematicCloud"); word kinematicCloudName("kinematicCloud");
args.optionReadIfPresent("cloudName", kinematicCloudName); args.optionReadIfPresent("cloudName", kinematicCloudName);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicTypeCloud kinematicCloud basicKinematicTypeCloud kinematicCloud
( (
kinematicCloudName, kinematicCloudName,
rhoc, rhoc,
Uc, Uc,
muc, muc,
g g
); );
// Particle fraction upper limit // Particle fraction upper limit
scalar alphacMin scalar alphacMin
( (
1.0 1.0
- readScalar - readScalar
( (
kinematicCloud.particleProperties().subDict("constantProperties") kinematicCloud.particleProperties().subDict("constantProperties")
.lookup("alphaMax") .lookup("alphaMax")
) )
); );
// Update alphac from the particle locations // Update alphac from the particle locations
alphac = max(1.0 - kinematicCloud.theta(), alphacMin); alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
alphac.correctBoundaryConditions(); alphac.correctBoundaryConditions();
surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac)); surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
surfaceScalarField alphaPhic("alphaPhic", alphacf*phic); surfaceScalarField alphaPhic("alphaPhic", alphacf*phic);
autoPtr<PhaseIncompressibleTurbulenceModel<singlePhaseTransportModel> > autoPtr<PhaseIncompressibleTurbulenceModel<singlePhaseTransportModel> >
continuousPhaseTurbulence continuousPhaseTurbulence
( (
PhaseIncompressibleTurbulenceModel<singlePhaseTransportModel>::New PhaseIncompressibleTurbulenceModel<singlePhaseTransportModel>::New
( (
alphac, alphac,
@ -161,4 +162,4 @@
phic, phic,
continuousPhaseTransport continuousPhaseTransport
) )
); );

View File

@ -1,42 +1,42 @@
Info<< "Creating combustion model\n" << endl; Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> combustion autoPtr<combustionModels::psiCombustionModel> combustion
( (
combustionModels::psiCombustionModel::New(mesh) combustionModels::psiCombustionModel::New(mesh)
); );
psiReactionThermo& thermo = combustion->thermo(); psiReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie)) if (!composition.contains(inertSpecie))
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in " << "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species() << "species list. Available species:" << composition.species()
<< exit(FatalError); << exit(FatalError);
} }
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i) forAll(Y, i)
{ {
fields.add(Y[i]); fields.add(Y[i]);
} }
fields.add(thermo.he()); fields.add(thermo.he());
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -46,11 +46,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
// lagrangian effective density field - used externally (optional) // lagrangian effective density field - used externally (optional)
volScalarField rhoEffLagrangian volScalarField rhoEffLagrangian
( (
IOobject IOobject
( (
"rhoEffLagrangian", "rhoEffLagrangian",
@ -61,11 +61,11 @@
), ),
mesh, mesh,
dimensionedScalar("zero", dimDensity, 0.0) dimensionedScalar("zero", dimDensity, 0.0)
); );
// dynamic pressure field - used externally (optional) // dynamic pressure field - used externally (optional)
volScalarField pDyn volScalarField pDyn
( (
IOobject IOobject
( (
"pDyn", "pDyn",
@ -76,12 +76,12 @@
), ),
mesh, mesh,
dimensionedScalar("zero", dimPressure, 0.0) dimensionedScalar("zero", dimPressure, 0.0)
); );
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -91,13 +91,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl; mesh.setFluxRequired(p.name());
autoPtr<compressible::turbulenceModel> turbulence
( Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -105,14 +107,14 @@
phi, phi,
thermo thermo
) )
); );
// Set the turbulence into the combustion model // Set the turbulence into the combustion model
combustion->setTurbulence(turbulence()); combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -121,13 +123,13 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
volScalarField dQ volScalarField dQ
( (
IOobject IOobject
( (
"dQ", "dQ",
@ -138,4 +140,4 @@
), ),
mesh, mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
); );

View File

@ -1,23 +1,23 @@
Info<< "Creating combustion model\n" << endl; Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> combustion autoPtr<combustionModels::psiCombustionModel> combustion
( (
combustionModels::psiCombustionModel::New(mesh) combustionModels::psiCombustionModel::New(mesh)
); );
psiReactionThermo& thermo = combustion->thermo(); psiReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));
Info<< "Creating field rho\n" << endl; Info<< "Creating field rho\n" << endl;
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -27,15 +27,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -45,13 +45,13 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -59,14 +59,14 @@
phi, phi,
thermo thermo
) )
); );
// Set the turbulence into the combustion model // Set the turbulence into the combustion model
combustion->setTurbulence(turbulence()); combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -75,19 +75,19 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -97,21 +97,23 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; mesh.setFluxRequired(p_rgh.name());
forAll(Y, i) multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
{
forAll(Y, i)
{
fields.add(Y[i]); fields.add(Y[i]);
} }
fields.add(thermo.he()); fields.add(thermo.he());
IOdictionary additionalControlsDict IOdictionary additionalControlsDict
( (
IOobject IOobject
( (
"additionalControls", "additionalControls",
@ -120,15 +122,15 @@
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
); );
Switch solvePrimaryRegion Switch solvePrimaryRegion
( (
additionalControlsDict.lookup("solvePrimaryRegion") additionalControlsDict.lookup("solvePrimaryRegion")
); );
volScalarField dQ volScalarField dQ
( (
IOobject IOobject
( (
"dQ", "dQ",
@ -139,4 +141,4 @@
), ),
mesh, mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
); );

View File

@ -1,34 +1,34 @@
Info<< "Creating combustion model\n" << endl; Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion autoPtr<combustionModels::rhoCombustionModel> combustion
( (
combustionModels::rhoCombustionModel::New(mesh) combustionModels::rhoCombustionModel::New(mesh)
); );
rhoReactionThermo& thermo = combustion->thermo(); rhoReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie)) if (!composition.contains(inertSpecie))
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in " << "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species() << "species list. Available species:" << composition.species()
<< exit(FatalError); << exit(FatalError);
} }
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -38,11 +38,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -52,12 +52,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
dimensionedScalar rhoMax mesh.setFluxRequired(p.name());
(
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMax", "rhoMax",
@ -65,10 +67,10 @@
GREAT, GREAT,
dimDensity dimDensity
) )
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMin", "rhoMin",
@ -76,11 +78,11 @@
0, 0,
dimDensity dimDensity
) )
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -88,14 +90,14 @@
phi, phi,
thermo thermo
) )
); );
// Set the turbulence into the combustion model // Set the turbulence into the combustion model
combustion->setTurbulence(turbulence()); combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -104,22 +106,22 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
Info<< "Creating multi-variate interpolation scheme\n" << endl; Info<< "Creating multi-variate interpolation scheme\n" << endl;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i) forAll(Y, i)
{ {
fields.add(Y[i]); fields.add(Y[i]);
} }
fields.add(thermo.he()); fields.add(thermo.he());
volScalarField dQ volScalarField dQ
( (
IOobject IOobject
( (
"dQ", "dQ",
@ -130,4 +132,4 @@
), ),
mesh, mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
); );

View File

@ -1,34 +1,34 @@
Info<< "Creating combustion model\n" << endl; Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion autoPtr<combustionModels::rhoCombustionModel> combustion
( (
combustionModels::rhoCombustionModel::New(mesh) combustionModels::rhoCombustionModel::New(mesh)
); );
rhoReactionThermo& thermo = combustion->thermo(); rhoReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie)) if (!composition.contains(inertSpecie))
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in " << "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species() << "species list. Available species:" << composition.species()
<< exit(FatalError); << exit(FatalError);
} }
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -38,11 +38,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -52,13 +52,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
dimensionedScalar rhoMax dimensionedScalar rhoMax
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMax", "rhoMax",
@ -66,10 +67,10 @@
GREAT, GREAT,
dimDensity dimDensity
) )
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMin", "rhoMin",
@ -77,11 +78,11 @@
0, 0,
dimDensity dimDensity
) )
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -89,22 +90,22 @@
phi, phi,
thermo thermo
) )
); );
// Set the turbulence into the combustion model // Set the turbulence into the combustion model
combustion->setTurbulence(turbulence()); combustion->setTurbulence(turbulence());
Info<< "Creating multi-variate interpolation scheme\n" << endl; Info<< "Creating multi-variate interpolation scheme\n" << endl;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i) forAll(Y, i)
{ {
fields.add(Y[i]); fields.add(Y[i]);
} }
fields.add(thermo.he()); fields.add(thermo.he());
volScalarField dQ volScalarField dQ
( (
IOobject IOobject
( (
"dQ", "dQ",
@ -115,4 +116,4 @@
), ),
mesh, mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
); );

View File

@ -1,34 +1,34 @@
Info<< "Creating combustion model\n" << endl; Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::psiCombustionModel> combustion autoPtr<combustionModels::psiCombustionModel> combustion
( (
combustionModels::psiCombustionModel::New(mesh) combustionModels::psiCombustionModel::New(mesh)
); );
psiReactionThermo& thermo = combustion->thermo(); psiReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e"); thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo); SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition(); basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y(); PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie")); const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie)) if (!composition.contains(inertSpecie))
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in " << "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species() << "species list. Available species:" << composition.species()
<< exit(FatalError); << exit(FatalError);
} }
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -38,11 +38,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
thermo.rho() thermo.rho()
); );
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -52,12 +52,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
dimensionedScalar rhoMax mesh.setFluxRequired(p.name());
(
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMax", "rhoMax",
@ -65,10 +67,10 @@
GREAT, GREAT,
dimDensity dimDensity
) )
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
dimensionedScalar::lookupOrDefault dimensionedScalar::lookupOrDefault
( (
"rhoMin", "rhoMin",
@ -76,11 +78,11 @@
0, 0,
dimDensity dimDensity
) )
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -88,14 +90,14 @@
phi, phi,
thermo thermo
) )
); );
// Set the turbulence into the combustion model // Set the turbulence into the combustion model
combustion->setTurbulence(turbulence()); combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -104,20 +106,20 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i) forAll(Y, i)
{ {
fields.add(Y[i]); fields.add(Y[i]);
} }
fields.add(thermo.he()); fields.add(thermo.he());
volScalarField dQ volScalarField dQ
( (
IOobject IOobject
( (
"dQ", "dQ",
@ -128,4 +130,4 @@
), ),
mesh, mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
); );

View File

@ -19,6 +19,8 @@ correctUphiBCs(U, phi);
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)")); surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"));
dimensionedScalar rAUf("rAUf", dimTime, 1.0); dimensionedScalar rAUf("rAUf", dimTime, 1.0);
mesh.setFluxRequired(pcorr.name());
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pcorrEqn fvScalarMatrix pcorrEqn

View File

@ -1,6 +1,6 @@
Info<< "Reading field p\n" << endl; Info<< "Reading field p\n" << endl;
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -10,10 +10,10 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -23,11 +23,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -37,13 +37,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
// Mass flux (corrected by rhoEqn.H) mesh.setFluxRequired(p.name());
surfaceScalarField rhoPhi
( // Mass flux (corrected by rhoEqn.H)
surfaceScalarField rhoPhi
(
IOobject IOobject
( (
"rhoPhi", "rhoPhi",
@ -53,37 +55,40 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
fvc::interpolate(rho)*phi fvc::interpolate(rho)*phi
); );
Info<< "Reading transportProperties\n" << endl; Info<< "Reading transportProperties\n" << endl;
incompressibleTwoPhaseMixture mixture(U, phi); incompressibleTwoPhaseMixture mixture(U, phi);
volScalarField& alphav(mixture.alpha1()); volScalarField& alphav(mixture.alpha1());
alphav.oldTime(); alphav.oldTime();
volScalarField& alphal(mixture.alpha2()); volScalarField& alphal(mixture.alpha2());
Info<< "Creating compressibilityModel\n" << endl; Info<< "Creating compressibilityModel\n" << endl;
autoPtr<barotropicCompressibilityModel> psiModel = autoPtr<barotropicCompressibilityModel> psiModel =
barotropicCompressibilityModel::New barotropicCompressibilityModel::New
( (
thermodynamicProperties, thermodynamicProperties,
alphav alphav
); );
const volScalarField& psi = psiModel->psi(); const volScalarField& psi = psiModel->psi();
rho == max rho == max
( (
psi*p psi*p
+ alphal*rhol0 + alphal*rhol0
+ ((alphav*psiv + alphal*psil) - psi)*pSat, + ((alphav*psiv + alphal*psil) - psi)*pSat,
rhoMin rhoMin
); );
// Create incompressible turbulence model mesh.setFluxRequired(p.name());
autoPtr<incompressible::turbulenceModel> turbulence mesh.setFluxRequired(rho.name());
(
// Create incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, mixture) incompressible::turbulenceModel::New(U, phi, mixture)
); );

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,27 +24,27 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
Info<< "Constructing twoPhaseMixtureThermo\n" << endl; Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
twoPhaseMixtureThermo mixture(mesh); twoPhaseMixtureThermo mixture(mesh);
volScalarField& alpha1(mixture.alpha1()); volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2()); volScalarField& alpha2(mixture.alpha2());
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties\n" << endl;
volScalarField& p = mixture.p(); volScalarField& p = mixture.p();
volScalarField& T = mixture.T(); volScalarField& T = mixture.T();
volScalarField& rho1 = mixture.thermo1().rho(); volScalarField& rho1 = mixture.thermo1().rho();
const volScalarField& psi1 = mixture.thermo1().psi(); const volScalarField& psi1 = mixture.thermo1().psi();
volScalarField& rho2 = mixture.thermo2().rho(); volScalarField& rho2 = mixture.thermo2().rho();
const volScalarField& psi2 = mixture.thermo2().psi(); const volScalarField& psi2 = mixture.thermo2().psi();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -54,27 +54,29 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
alpha1*rho1 + alpha2*rho2 alpha1*rho1 + alpha2*rho2
); );
dimensionedScalar pMin dimensionedScalar pMin
( (
"pMin", "pMin",
dimPressure, dimPressure,
mixture.lookup("pMin") mixture.lookup("pMin")
); );
mesh.setFluxRequired(p_rgh.name());
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
// Mass flux // Mass flux
// Initialisation does not matter because rhoPhi is reset after the // Initialisation does not matter because rhoPhi is reset after the
// alpha1 solution before it is used in the U equation. // alpha1 solution before it is used in the U equation.
surfaceScalarField rhoPhi surfaceScalarField rhoPhi
( (
IOobject IOobject
( (
"rhoPhi", "rhoPhi",
@ -84,21 +86,21 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
fvc::interpolate(rho)*phi fvc::interpolate(rho)*phi
); );
volScalarField dgdt volScalarField dgdt
( (
pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001)) pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001))
); );
// Construct interface from alpha1 distribution // Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, mixture); interfaceProperties interface(alpha1, U, mixture);
// Construct compressible turbulence model // Construct compressible turbulence model
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New(rho, U, rhoPhi, mixture) compressible::turbulenceModel::New(rho, U, rhoPhi, mixture)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,18 +24,18 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
Info<< "Constructing multiphaseMixtureThermo\n" << endl; Info<< "Constructing multiphaseMixtureThermo\n" << endl;
multiphaseMixtureThermo mixture(U, phi); multiphaseMixtureThermo mixture(U, phi);
volScalarField& p = mixture.p(); volScalarField& p = mixture.p();
volScalarField& T = mixture.T(); volScalarField& T = mixture.T();
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -44,19 +44,21 @@
IOobject::READ_IF_PRESENT IOobject::READ_IF_PRESENT
), ),
mixture.rho() mixture.rho()
); );
dimensionedScalar pMin(mixture.lookup("pMin")); dimensionedScalar pMin(mixture.lookup("pMin"));
mesh.setFluxRequired(p_rgh.name());
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
// Construct compressible turbulence model // Construct compressible turbulence model
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
( (
rho, rho,
@ -64,7 +66,7 @@
mixture.rhoPhi(), mixture.rhoPhi(),
mixture mixture
) )
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,23 +24,23 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
Info<< "Reading incompressibleTwoPhaseInteractingMixture\n" << endl; Info<< "Reading incompressibleTwoPhaseInteractingMixture\n" << endl;
incompressibleTwoPhaseInteractingMixture mixture(U, phi); incompressibleTwoPhaseInteractingMixture mixture(U, phi);
volScalarField& alpha1(mixture.alpha1()); volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2()); volScalarField& alpha2(mixture.alpha2());
const dimensionedScalar& rho1 = mixture.rhod(); const dimensionedScalar& rho1 = mixture.rhod();
const dimensionedScalar& rho2 = mixture.rhoc(); const dimensionedScalar& rho2 = mixture.rhoc();
// Mixture density // Mixture density
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -50,11 +50,11 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mixture.rho() mixture.rho()
); );
// Mass flux // Mass flux
surfaceScalarField rhoPhi surfaceScalarField rhoPhi
( (
IOobject IOobject
( (
"rhoPhi", "rhoPhi",
@ -64,40 +64,40 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
fvc::interpolate(rho)*phi fvc::interpolate(rho)*phi
); );
// Relative Velocity // Relative Velocity
autoPtr<relativeVelocityModel> UdmModelPtr autoPtr<relativeVelocityModel> UdmModelPtr
( (
relativeVelocityModel::New relativeVelocityModel::New
( (
mixture, mixture,
mixture mixture
) )
); );
relativeVelocityModel& UdmModel(UdmModelPtr()); relativeVelocityModel& UdmModel(UdmModelPtr());
// Construct compressible turbulence model // Construct compressible turbulence model
autoPtr autoPtr
< <
CompressibleTurbulenceModel<incompressibleTwoPhaseInteractingMixture> CompressibleTurbulenceModel<incompressibleTwoPhaseInteractingMixture>
> turbulence > turbulence
( (
CompressibleTurbulenceModel<incompressibleTwoPhaseInteractingMixture> CompressibleTurbulenceModel<incompressibleTwoPhaseInteractingMixture>
::New(rho, U, rhoPhi, mixture) ::New(rho, U, rhoPhi, mixture)
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -107,21 +107,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rho*gh p_rgh + rho*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
@ -129,8 +129,10 @@
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
} }
mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name());
// MULES Correction // MULES Correction
tmp<surfaceScalarField> tphiAlphaCorr0; tmp<surfaceScalarField> tphiAlphaCorr0;

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,24 +24,24 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
Info<< "Reading transportProperties\n" << endl; Info<< "Reading transportProperties\n" << endl;
immiscibleIncompressibleTwoPhaseMixture mixture(U, phi); immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
volScalarField& alpha1(mixture.alpha1()); volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2()); volScalarField& alpha2(mixture.alpha2());
const dimensionedScalar& rho1 = mixture.rho1(); const dimensionedScalar& rho1 = mixture.rho1();
const dimensionedScalar& rho2 = mixture.rho2(); const dimensionedScalar& rho2 = mixture.rho2();
// Need to store rho for ddt(rho, U) // Need to store rho for ddt(rho, U)
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -51,13 +51,13 @@
), ),
alpha1*rho1 + alpha2*rho2, alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types() alpha1.boundaryField().types()
); );
rho.oldTime(); rho.oldTime();
// Mass flux // Mass flux
surfaceScalarField rhoPhi surfaceScalarField rhoPhi
( (
IOobject IOobject
( (
"rhoPhi", "rhoPhi",
@ -67,23 +67,23 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
fvc::interpolate(rho)*phi fvc::interpolate(rho)*phi
); );
// Construct incompressible turbulence model // Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, mixture) incompressible::turbulenceModel::New(U, phi, mixture)
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -93,21 +93,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rho*gh p_rgh + rho*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
@ -115,11 +115,14 @@
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
} }
// MULES flux from previous time-step mesh.setFluxRequired(p_rgh.name());
surfaceScalarField phiAlpha mesh.setFluxRequired(alpha1.name());
(
// MULES flux from previous time-step
surfaceScalarField phiAlpha
(
IOobject IOobject
( (
"phiAlpha", "phiAlpha",
@ -129,7 +132,7 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
phi*fvc::interpolate(alpha1) phi*fvc::interpolate(alpha1)
); );
// MULES Correction // MULES Correction
tmp<surfaceScalarField> tphiAlphaCorr0; tmp<surfaceScalarField> tphiAlphaCorr0;

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,25 +24,25 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
immiscibleIncompressibleThreePhaseMixture mixture(U, phi); immiscibleIncompressibleThreePhaseMixture mixture(U, phi);
volScalarField& alpha1(mixture.alpha1()); volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2()); volScalarField& alpha2(mixture.alpha2());
volScalarField& alpha3(mixture.alpha3()); volScalarField& alpha3(mixture.alpha3());
const dimensionedScalar& rho1 = mixture.rho1(); const dimensionedScalar& rho1 = mixture.rho1();
const dimensionedScalar& rho2 = mixture.rho2(); const dimensionedScalar& rho2 = mixture.rho2();
const dimensionedScalar& rho3 = mixture.rho3(); const dimensionedScalar& rho3 = mixture.rho3();
dimensionedScalar D23(mixture.lookup("D23")); dimensionedScalar D23(mixture.lookup("D23"));
// Need to store rho for ddt(rho, U) // Need to store rho for ddt(rho, U)
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -52,15 +52,15 @@
), ),
alpha1*rho1 + alpha2*rho2 + alpha3*rho3, alpha1*rho1 + alpha2*rho2 + alpha3*rho3,
alpha1.boundaryField().types() alpha1.boundaryField().types()
); );
rho.oldTime(); rho.oldTime();
// Mass flux // Mass flux
// Initialisation does not matter because rhoPhi is reset after the // Initialisation does not matter because rhoPhi is reset after the
// alpha solution before it is used in the U equation. // alpha solution before it is used in the U equation.
surfaceScalarField rhoPhi surfaceScalarField rhoPhi
( (
IOobject IOobject
( (
"rhoPhi", "rhoPhi",
@ -70,21 +70,21 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
rho1*phi rho1*phi
); );
// Construct incompressible turbulence model // Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, mixture) incompressible::turbulenceModel::New(U, phi, mixture)
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -94,21 +94,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rho*gh p_rgh + rho*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
@ -116,4 +116,7 @@
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
} }
mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha2.name());

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,26 +24,26 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl; Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
autoPtr<phaseChangeTwoPhaseMixture> mixture = autoPtr<phaseChangeTwoPhaseMixture> mixture =
phaseChangeTwoPhaseMixture::New(U, phi); phaseChangeTwoPhaseMixture::New(U, phi);
volScalarField& alpha1(mixture->alpha1()); volScalarField& alpha1(mixture->alpha1());
volScalarField& alpha2(mixture->alpha2()); volScalarField& alpha2(mixture->alpha2());
const dimensionedScalar& rho1 = mixture->rho1(); const dimensionedScalar& rho1 = mixture->rho1();
const dimensionedScalar& rho2 = mixture->rho2(); const dimensionedScalar& rho2 = mixture->rho2();
const dimensionedScalar& pSat = mixture->pSat(); const dimensionedScalar& pSat = mixture->pSat();
// Need to store rho for ddt(rho, U) // Need to store rho for ddt(rho, U)
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -53,27 +53,27 @@
), ),
alpha1*rho1 + alpha2*rho2, alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types() alpha1.boundaryField().types()
); );
rho.oldTime(); rho.oldTime();
// Construct interface from alpha1 distribution // Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, mixture()); interfaceProperties interface(alpha1, U, mixture());
// Construct incompressible turbulence model // Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, mixture()) incompressible::turbulenceModel::New(U, phi, mixture())
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -83,21 +83,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rho*gh p_rgh + rho*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
@ -105,4 +105,7 @@
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
} }
mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name());

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,10 +10,10 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,10 +24,10 @@
), ),
mesh, mesh,
dimensionedVector("U", dimVelocity, vector::zero) dimensionedVector("U", dimVelocity, vector::zero)
); );
surfaceScalarField phi surfaceScalarField phi
( (
IOobject IOobject
( (
"phi", "phi",
@ -38,34 +38,34 @@
), ),
mesh, mesh,
dimensionedScalar("phi", dimArea*dimVelocity, 0) dimensionedScalar("phi", dimArea*dimVelocity, 0)
); );
multiphaseSystem fluid(U, phi); multiphaseSystem fluid(U, phi);
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{ {
phaseModel& phase = iter(); phaseModel& phase = iter();
const volScalarField& alpha = phase; const volScalarField& alpha = phase;
U += alpha*phase.U(); U += alpha*phase.U();
phi += fvc::interpolate(alpha)*phase.phi(); phi += fvc::interpolate(alpha)*phase.phi();
} }
scalar slamDampCoeff scalar slamDampCoeff
( (
fluid.lookupOrDefault<scalar>("slamDampCoeff", 1) fluid.lookupOrDefault<scalar>("slamDampCoeff", 1)
); );
dimensionedScalar maxSlamVelocity dimensionedScalar maxSlamVelocity
( (
"maxSlamVelocity", "maxSlamVelocity",
dimVelocity, dimVelocity,
fluid.lookupOrDefault<scalar>("maxSlamVelocity", GREAT) fluid.lookupOrDefault<scalar>("maxSlamVelocity", GREAT)
); );
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -75,23 +75,23 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
fluid.rho() fluid.rho()
); );
// Construct incompressible turbulence model // Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, fluid) incompressible::turbulenceModel::New(U, phi, fluid)
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -101,15 +101,16 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rho*gh p_rgh + rho*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
mesh.setFluxRequired(p_rgh.name());

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,15 +24,15 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
multiphaseMixture mixture(U, phi); multiphaseMixture mixture(U, phi);
// Need to store rho for ddt(rho, U) // Need to store rho for ddt(rho, U)
volScalarField rho volScalarField rho
( (
IOobject IOobject
( (
"rho", "rho",
@ -41,25 +41,25 @@
IOobject::READ_IF_PRESENT IOobject::READ_IF_PRESENT
), ),
mixture.rho() mixture.rho()
); );
rho.oldTime(); rho.oldTime();
const surfaceScalarField& rhoPhi(mixture.rhoPhi()); const surfaceScalarField& rhoPhi(mixture.rhoPhi());
// Construct incompressible turbulence model // Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, mixture) incompressible::turbulenceModel::New(U, phi, mixture)
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -69,25 +69,27 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rho*gh p_rgh + rho*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
p.dimensions(), p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
} }
mesh.setFluxRequired(p_rgh.name());

View File

@ -1,6 +1,6 @@
Info<< "Reading field p (kinematic)\n" << endl; Info<< "Reading field p (kinematic)\n" << endl;
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,22 +24,22 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, laminarTransport) incompressible::turbulenceModel::New(U, phi, laminarTransport)
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
Info<< "Creating field zeta\n" << endl; Info<< "Creating field zeta\n" << endl;
volVectorField zeta volVectorField zeta
( (
IOobject IOobject
( (
"zeta", "zeta",
@ -50,11 +50,11 @@
), ),
mesh, mesh,
dimensionedVector("zero", dimLength, vector::zero) dimensionedVector("zero", dimLength, vector::zero)
); );
Info<< "Creating field p_gh\n" << endl; Info<< "Creating field p_gh\n" << endl;
volScalarField p_gh volScalarField p_gh
( (
IOobject IOobject
( (
"p_gh", "p_gh",
@ -64,13 +64,14 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
// Force p_gh to be consistent with p // Force p_gh to be consistent with p
// Height is made relative to field 'refLevel' // Height is made relative to field 'refLevel'
p_gh = p - (g & mesh.C()); p_gh = p - (g & mesh.C());
label p_ghRefCell = 0; label p_ghRefCell = 0;
scalar p_ghRefValue = 0.0; scalar p_ghRefValue = 0.0;
setRefCell(p_gh, pimple.dict(), p_ghRefCell, p_ghRefValue); setRefCell(p_gh, pimple.dict(), p_ghRefCell, p_ghRefValue);
mesh.setFluxRequired(p_gh.name());

View File

@ -1,55 +1,55 @@
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
Info<< "Creating phaseSystem\n" << endl; Info<< "Creating phaseSystem\n" << endl;
autoPtr<twoPhaseSystem> fluidPtr autoPtr<twoPhaseSystem> fluidPtr
( (
twoPhaseSystem::New(mesh) twoPhaseSystem::New(mesh)
); );
twoPhaseSystem& fluid = fluidPtr(); twoPhaseSystem& fluid = fluidPtr();
phaseModel& phase1 = fluid.phase1(); phaseModel& phase1 = fluid.phase1();
phaseModel& phase2 = fluid.phase2(); phaseModel& phase2 = fluid.phase2();
volScalarField& alpha1 = phase1; volScalarField& alpha1 = phase1;
volScalarField& alpha2 = phase2; volScalarField& alpha2 = phase2;
volVectorField& U1 = phase1.U(); volVectorField& U1 = phase1.U();
surfaceScalarField& phi1 = phase1.phi(); surfaceScalarField& phi1 = phase1.phi();
surfaceScalarField& alphaPhi1 = phase1.alphaPhi(); surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
surfaceScalarField& alphaRhoPhi1 = phase1.alphaRhoPhi(); surfaceScalarField& alphaRhoPhi1 = phase1.alphaRhoPhi();
volVectorField& U2 = phase2.U(); volVectorField& U2 = phase2.U();
surfaceScalarField& phi2 = phase2.phi(); surfaceScalarField& phi2 = phase2.phi();
surfaceScalarField& alphaPhi2 = phase2.alphaPhi(); surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
surfaceScalarField& alphaRhoPhi2 = phase2.alphaRhoPhi(); surfaceScalarField& alphaRhoPhi2 = phase2.alphaRhoPhi();
surfaceScalarField& phi = fluid.phi(); surfaceScalarField& phi = fluid.phi();
dimensionedScalar pMin dimensionedScalar pMin
( (
"pMin", "pMin",
dimPressure, dimPressure,
fluid.lookup("pMin") fluid.lookup("pMin")
); );
#include "gh.H" #include "gh.H"
rhoThermo& thermo1 = phase1.thermo(); rhoThermo& thermo1 = phase1.thermo();
rhoThermo& thermo2 = phase2.thermo(); rhoThermo& thermo2 = phase2.thermo();
volScalarField& p = thermo1.p(); volScalarField& p = thermo1.p();
volScalarField& rho1 = thermo1.rho(); volScalarField& rho1 = thermo1.rho();
const volScalarField& psi1 = thermo1.psi(); const volScalarField& psi1 = thermo1.psi();
volScalarField& rho2 = thermo2.rho(); volScalarField& rho2 = thermo2.rho();
const volScalarField& psi2 = thermo2.psi(); const volScalarField& psi2 = thermo2.psi();
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -59,18 +59,20 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name());
const IOMRFZoneList& MRF = fluid.MRF(); const IOMRFZoneList& MRF = fluid.MRF();
fv::IOoptionList& fvOptions = fluid.fvOptions(); fv::IOoptionList& fvOptions = fluid.fvOptions();

View File

@ -1,6 +1,6 @@
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -10,11 +10,11 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -24,34 +24,34 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
#include "createPhi.H" #include "createPhi.H"
Info<< "Reading transportProperties\n" << endl; Info<< "Reading transportProperties\n" << endl;
incompressibleTwoPhaseMixture mixture(U, phi); incompressibleTwoPhaseMixture mixture(U, phi);
volScalarField& alpha1(mixture.alpha1()); volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2()); volScalarField& alpha2(mixture.alpha2());
const dimensionedScalar& rho1 = mixture.rho1(); const dimensionedScalar& rho1 = mixture.rho1();
const dimensionedScalar& rho2 = mixture.rho2(); const dimensionedScalar& rho2 = mixture.rho2();
dimensionedScalar Dab(mixture.lookup("Dab")); dimensionedScalar Dab(mixture.lookup("Dab"));
// Read the reciprocal of the turbulent Schmidt number // Read the reciprocal of the turbulent Schmidt number
dimensionedScalar alphatab(mixture.lookup("alphatab")); dimensionedScalar alphatab(mixture.lookup("alphatab"));
// Need to store rho for ddt(rho, U) // Need to store rho for ddt(rho, U)
volScalarField rho("rho", alpha1*rho1 + alpha2*rho2); volScalarField rho("rho", alpha1*rho1 + alpha2*rho2);
rho.oldTime(); rho.oldTime();
// Mass flux // Mass flux
// Initialisation does not matter because rhoPhi is reset after the // Initialisation does not matter because rhoPhi is reset after the
// alpha1 solution before it is used in the U equation. // alpha1 solution before it is used in the U equation.
surfaceScalarField rhoPhi surfaceScalarField rhoPhi
( (
IOobject IOobject
( (
"rhoPhi", "rhoPhi",
@ -61,22 +61,22 @@
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
rho1*phi rho1*phi
); );
// Construct incompressible turbulence model // Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<incompressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, mixture) incompressible::turbulenceModel::New(U, phi, mixture)
); );
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
#include "gh.H" #include "gh.H"
volScalarField p volScalarField p
( (
IOobject IOobject
( (
"p", "p",
@ -86,21 +86,21 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
p_rgh + rho*gh p_rgh + rho*gh
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
@ -108,4 +108,7 @@
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
} }
mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name());

View File

@ -1,51 +1,51 @@
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "readhRef.H" #include "readhRef.H"
Info<< "Creating twoPhaseSystem\n" << endl; Info<< "Creating twoPhaseSystem\n" << endl;
twoPhaseSystem fluid(mesh, g); twoPhaseSystem fluid(mesh, g);
phaseModel& phase1 = fluid.phase1(); phaseModel& phase1 = fluid.phase1();
phaseModel& phase2 = fluid.phase2(); phaseModel& phase2 = fluid.phase2();
volScalarField& alpha1 = phase1; volScalarField& alpha1 = phase1;
volScalarField& alpha2 = phase2; volScalarField& alpha2 = phase2;
volVectorField& U1 = phase1.U(); volVectorField& U1 = phase1.U();
surfaceScalarField& phi1 = phase1.phi(); surfaceScalarField& phi1 = phase1.phi();
surfaceScalarField& alphaPhi1 = phase1.alphaPhi(); surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
surfaceScalarField& alphaRhoPhi1 = phase1.alphaRhoPhi(); surfaceScalarField& alphaRhoPhi1 = phase1.alphaRhoPhi();
volVectorField& U2 = phase2.U(); volVectorField& U2 = phase2.U();
surfaceScalarField& phi2 = phase2.phi(); surfaceScalarField& phi2 = phase2.phi();
surfaceScalarField& alphaPhi2 = phase2.alphaPhi(); surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
surfaceScalarField& alphaRhoPhi2 = phase2.alphaRhoPhi(); surfaceScalarField& alphaRhoPhi2 = phase2.alphaRhoPhi();
surfaceScalarField& phi = fluid.phi(); surfaceScalarField& phi = fluid.phi();
dimensionedScalar pMin dimensionedScalar pMin
( (
"pMin", "pMin",
dimPressure, dimPressure,
fluid.lookup("pMin") fluid.lookup("pMin")
); );
#include "gh.H" #include "gh.H"
rhoThermo& thermo1 = phase1.thermo(); rhoThermo& thermo1 = phase1.thermo();
rhoThermo& thermo2 = phase2.thermo(); rhoThermo& thermo2 = phase2.thermo();
volScalarField& p = thermo1.p(); volScalarField& p = thermo1.p();
volScalarField& rho1 = thermo1.rho(); volScalarField& rho1 = thermo1.rho();
const volScalarField& psi1 = thermo1.psi(); const volScalarField& psi1 = thermo1.psi();
volScalarField& rho2 = thermo2.rho(); volScalarField& rho2 = thermo2.rho();
const volScalarField& psi2 = thermo2.psi(); const volScalarField& psi2 = thermo2.psi();
Info<< "Reading field p_rgh\n" << endl; Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh volScalarField p_rgh
( (
IOobject IOobject
( (
"p_rgh", "p_rgh",
@ -55,10 +55,10 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh mesh
); );
volVectorField U volVectorField U
( (
IOobject IOobject
( (
"U", "U",
@ -68,22 +68,24 @@
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
fluid.U() fluid.U()
); );
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p, p,
p_rgh, p_rgh,
pimple.dict(), pimple.dict(),
pRefCell, pRefCell,
pRefValue pRefValue
); );
mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name());
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt
( (
IOobject IOobject
( (
"dpdt", "dpdt",
@ -92,9 +94,9 @@
), ),
mesh, mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
); );
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K1(IOobject::groupName("K", phase1.name()), 0.5*magSqr(U1)); volScalarField K1(IOobject::groupName("K", phase1.name()), 0.5*magSqr(U1));
volScalarField K2(IOobject::groupName("K", phase2.name()), 0.5*magSqr(U2)); volScalarField K2(IOobject::groupName("K", phase2.name()), 0.5*magSqr(U2));

View File

@ -72,3 +72,5 @@ else
{ {
divSigmaExp -= fvc::div((2*mu + lambda)*fvc::grad(D), "div(sigmaD)"); divSigmaExp -= fvc::div((2*mu + lambda)*fvc::grad(D), "div(sigmaD)");
} }
mesh.setFluxRequired(D.name());

View File

@ -89,6 +89,8 @@ void Foam::CorrectPhi
fvc::makeAbsolute(phi, U); fvc::makeAbsolute(phi, U);
} }
mesh.setFluxRequired(pcorr.name());
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
// Solve for pcorr such that the divergence of the corrected flux // Solve for pcorr such that the divergence of the corrected flux
@ -156,6 +158,8 @@ void Foam::CorrectPhi
pcorrTypes pcorrTypes
); );
mesh.setFluxRequired(pcorr.name());
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
// Solve for pcorr such that the divergence of the corrected flux // Solve for pcorr such that the divergence of the corrected flux

View File

@ -558,7 +558,7 @@ Foam::ITstream& Foam::fvSchemes::laplacianScheme(const word& name) const
} }
void Foam::fvSchemes::setFluxRequired(const word& name) void Foam::fvSchemes::setFluxRequired(const word& name) const
{ {
if (debug) if (debug)
{ {

View File

@ -75,7 +75,7 @@ class fvSchemes
dictionary laplacianSchemes_; dictionary laplacianSchemes_;
ITstream defaultLaplacianScheme_; ITstream defaultLaplacianScheme_;
dictionary fluxRequired_; mutable dictionary fluxRequired_;
bool defaultFluxRequired_; bool defaultFluxRequired_;
//- Steady-state run indicator //- Steady-state run indicator
@ -130,7 +130,7 @@ public:
ITstream& laplacianScheme(const word& name) const; ITstream& laplacianScheme(const word& name) const;
void setFluxRequired(const word& name); void setFluxRequired(const word& name) const;
bool fluxRequired(const word& name) const; bool fluxRequired(const word& name) const;

View File

@ -108,6 +108,7 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
cloudName + ":uSqrAverage" cloudName + ":uSqrAverage"
); );
mesh.setFluxRequired(alpha_.name());
// Property fields // Property fields
// ~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~

View File

@ -383,7 +383,8 @@ void kinematicSingleLayer::solveThickness
"deltaCoeff", "deltaCoeff",
fvc::interpolate(delta_)*deltarUAf*rhof*fvc::interpolate(pp) fvc::interpolate(delta_)*deltarUAf*rhof*fvc::interpolate(pp)
); );
// constrainFilmField(ddrhorUAppf, 0.0);
regionMesh().setFluxRequired(delta_.name());
for (int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++)
{ {

View File

@ -106,7 +106,6 @@ divSchemes
laplacianSchemes { default Gauss linear corrected; } laplacianSchemes { default Gauss linear corrected; }
interpolationSchemes { default linear; } interpolationSchemes { default linear; }
snGradSchemes { default corrected; } snGradSchemes { default corrected; }
fluxRequired { default yes; }
EOF EOF
} }
@ -140,7 +139,6 @@ FV_SCHEMES=\
laplacianScheme \ laplacianScheme \
interpolationScheme \ interpolationScheme \
snGradScheme \ snGradScheme \
fluxRequired \
" "
SCHEMES_FILE="FvSchemes" SCHEMES_FILE="FvSchemes"
SCHEMES_TEMP="FvSchemes.temp" SCHEMES_TEMP="FvSchemes.temp"

View File

@ -46,11 +46,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,11 +47,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
T ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,11 +47,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
T ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -69,10 +69,4 @@ snGradSchemes
default limited corrected 0.333; default limited corrected 0.333;
} }
fluxRequired
{
default no;
p;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -67,11 +67,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,8 +29,4 @@ divSchemes
laplacianSchemes laplacianSchemes
{} {}
fluxRequired
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -32,9 +32,5 @@ laplacianSchemes
{ {
} }
fluxRequired
{
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,8 +29,4 @@ divSchemes
laplacianSchemes laplacianSchemes
{} {}
fluxRequired
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -71,11 +71,5 @@ snGradSchemes
default limited corrected 0.5; default limited corrected 0.5;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -43,11 +43,5 @@ snGradSchemes
default uncorrected; default uncorrected;
} }
fluxRequired
{
default no;
deltaf;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -64,11 +64,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -46,9 +46,5 @@ snGradSchemes
default uncorrected; default uncorrected;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -59,12 +59,4 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
phiMesh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -46,9 +46,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -61,11 +61,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -59,11 +59,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,11 +53,5 @@ snGradSchemes
default orthogonal; default orthogonal;
} }
fluxRequired
{
default no;
p;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,11 +53,5 @@ snGradSchemes
default orthogonal; default orthogonal;
} }
fluxRequired
{
default no;
p;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,12 +53,4 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
pcorr ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -54,11 +54,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -57,11 +57,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -57,11 +57,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -57,12 +57,6 @@ snGradSchemes
default orthogonal; default orthogonal;
} }
fluxRequired
{
default no;
p ;
}
wallDist wallDist
{ {
method meshWave; method meshWave;

View File

@ -51,11 +51,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -50,11 +50,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -50,11 +50,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -52,11 +52,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -55,11 +55,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p;
pCorr;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -55,12 +55,4 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
pcorr ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -52,11 +52,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -51,11 +51,5 @@ snGradSchemes
default orthogonal; default orthogonal;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,11 +53,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,11 +53,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,11 +47,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,10 +45,4 @@ snGradSchemes
default none; default none;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,10 +45,4 @@ snGradSchemes
default none; default none;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,10 +45,4 @@ snGradSchemes
default none; default none;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,10 +45,4 @@ snGradSchemes
default none; default none;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,10 +45,4 @@ snGradSchemes
default none; default none;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,10 +45,4 @@ snGradSchemes
default none; default none;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,10 +45,4 @@ snGradSchemes
default none; default none;
} }
fluxRequired
{
default no;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,11 +47,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
phi ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -49,12 +49,4 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p ;
pB ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,11 +53,5 @@ snGradSchemes
default uncorrected; default uncorrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -51,11 +51,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,11 +53,5 @@ snGradSchemes
default limited corrected 0.333; default limited corrected 0.333;
} }
fluxRequired
{
default no;
p_rgh ;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -55,11 +55,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -52,12 +52,6 @@ snGradSchemes
default orthogonal; default orthogonal;
} }
fluxRequired
{
default no;
p_rgh;
}
wallDist wallDist
{ {
method meshWave; method meshWave;

View File

@ -57,11 +57,5 @@ snGradSchemes
default uncorrected; default uncorrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -52,12 +52,6 @@ snGradSchemes
default orthogonal; default orthogonal;
} }
fluxRequired
{
default no;
p_rgh;
}
wallDist wallDist
{ {
method meshWave; method meshWave;

View File

@ -51,11 +51,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -52,11 +52,5 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -53,10 +53,4 @@ snGradSchemes
default corrected; default corrected;
} }
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* // // ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More