EEqns.H
Go to the documentation of this file.
1 {
2  volScalarField& he1 = thermo1.he();
4 
5  volScalarField Cpv1("Cpv1", thermo1.Cpv());
6  volScalarField Cpv2("Cpv2", thermo2.Cpv());
7 
8  volScalarField Kh(fluid.Kh());
9 
11  (
13  - fvm::Sp(contErr1, he1)
14 
16  - contErr1*K1
17  + (
18  he1.name() == thermo1.phasePropertyName("e")
20  + p*fvc::ddt(alpha1)
21  : -alpha1*dpdt
22  )
23 
24  - fvm::laplacian
25  (
26  fvc::interpolate(alpha1)
28  he1
29  )
30  );
31 
32  E1Eqn.relax();
33 
34  E1Eqn -=
35  (
36  Kh*(thermo2.T() - thermo1.T())
37  + Kh*he1/Cpv1
38  - fvm::Sp(Kh/Cpv1, he1)
39  + alpha1*rho1*(U1&g)
40  + fvOptions(alpha1, rho1, he1)
41  );
42 
44  (
46  - fvm::Sp(contErr2, he2)
47 
49  - contErr2*K2
50  + (
51  he2.name() == thermo2.phasePropertyName("e")
53  + p*fvc::ddt(alpha1)
54  : -alpha2*dpdt
55  )
56 
57  - fvm::laplacian
58  (
59  fvc::interpolate(alpha2)
61  he2
62  )
63  );
64 
65  E2Eqn.relax();
66 
67  E2Eqn -=
68  (
69  Kh*(thermo1.T() - thermo2.T())
70  + Kh*he2/Cpv2
71  - fvm::Sp(Kh/Cpv2, he2)
72  + alpha2*rho2*(U2&g)
74  );
75 
76  fvOptions.constrain(E1Eqn);
77  E1Eqn.solve();
78  fvOptions.correct(he1);
79 
80  fvOptions.constrain(E2Eqn);
81  E2Eqn.solve();
82  fvOptions.correct(he2);
83 
84  thermo1.correct();
85  Info<< "min " << thermo1.T().name()
86  << " " << min(thermo1.T()).value() << endl;
87 
88  thermo2.correct();
89  Info<< "min " << thermo2.T().name()
90  << " " << min(thermo2.T()).value() << endl;
91 }
alphaRhoPhi1
surfaceScalarField & alphaRhoPhi1
Definition: createFieldRefs.H:5
U1
volVectorField & U1
Definition: setRegionFluidFields.H:11
contErr2
contErr2
Definition: correctContErrs.H:5
p
volScalarField & p
Definition: createFieldRefs.H:8
turbulence
Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
K1
#define K1
Definition: SHA1.C:144
alpha2
const volScalarField & alpha2
Definition: setRegionFluidFields.H:9
contErr1
contErr1
Definition: correctContErrs.H:1
Sp
zeroField Sp
Definition: alphaSuSp.H:2
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
he2
volScalarField & he2
Definition: EEqns.H:3
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
thermo2
rhoThermo & thermo2
Definition: setRegionFluidFields.H:22
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Kh
volScalarField Kh(fluid.Kh())
rho2
volScalarField & rho2
Definition: setRegionFluidFields.H:30
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
K2
#define K2
Definition: SHA1.C:145
rho1
volScalarField & rho1
Definition: setRegionFluidFields.H:27
U2
volVectorField & U2
Definition: setRegionFluidFields.H:15
phase2
phaseModel & phase2
Definition: setRegionFluidFields.H:6
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
alphaPhi1
const surfaceScalarField & alphaPhi1
Definition: setRegionFluidFields.H:13
E2Eqn
E2Eqn
Definition: EEqns.H:67
alphaRhoPhi2
surfaceScalarField & alphaRhoPhi2
Definition: createFieldRefs.H:9
thermo1
rhoThermo & thermo1
Definition: setRegionFluidFields.H:21
Cpv2
volScalarField Cpv2("Cpv2", thermo2.Cpv())
E1Eqn
E1Eqn
Definition: EEqns.H:34
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
alphaEff
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:32
Cpv1
volScalarField Cpv1("Cpv1", thermo1.Cpv())
phase1
phaseModel & phase1
Definition: setRegionFluidFields.H:5
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::fac::interpolate
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Foam::fvc::absolute
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:190
alphaPhi2
const surfaceScalarField & alphaPhi2
Definition: setRegionFluidFields.H:17