mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Changed rhoCentralFoam to be e-based
This commit is contained in:
@ -7,7 +7,7 @@ autoPtr<basicPsiThermo> pThermo
|
||||
basicPsiThermo& thermo = pThermo();
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& h = thermo.h();
|
||||
volScalarField& e = thermo.e();
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& mu = thermo.mu();
|
||||
@ -70,7 +70,7 @@ volScalarField rhoE
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
rho*(h + 0.5*magSqr(U)) - p
|
||||
rho*(e + 0.5*magSqr(U))
|
||||
);
|
||||
|
||||
surfaceScalarField pos
|
||||
|
||||
@ -76,10 +76,10 @@ int main(int argc, char *argv[])
|
||||
surfaceScalarField rPsi_neg =
|
||||
fvc::interpolate(rPsi, neg, "reconstruct(T)");
|
||||
|
||||
surfaceScalarField h_pos =
|
||||
fvc::interpolate(h, pos, "reconstruct(T)");
|
||||
surfaceScalarField h_neg =
|
||||
fvc::interpolate(h, neg, "reconstruct(T)");
|
||||
surfaceScalarField e_pos =
|
||||
fvc::interpolate(e, pos, "reconstruct(T)");
|
||||
surfaceScalarField e_neg =
|
||||
fvc::interpolate(e, neg, "reconstruct(T)");
|
||||
|
||||
surfaceVectorField U_pos = rhoU_pos/rho_pos;
|
||||
surfaceVectorField U_neg = rhoU_neg/rho_neg;
|
||||
@ -132,8 +132,8 @@ int main(int argc, char *argv[])
|
||||
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf();
|
||||
|
||||
surfaceScalarField phiEp =
|
||||
aphiv_pos*rho_pos*(h_pos + 0.5*magSqr(U_pos))
|
||||
+ aphiv_neg*rho_neg*(h_neg + 0.5*magSqr(U_neg))
|
||||
aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
|
||||
+ aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
|
||||
+ aSf*p_pos - aSf*p_neg;
|
||||
|
||||
volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T()));
|
||||
@ -156,7 +156,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, U) - fvc::ddt(rho,U)
|
||||
fvm::ddt(rho, U) - fvc::ddt(rho, U)
|
||||
- fvm::laplacian(mu, U)
|
||||
- fvc::div(tauMC)
|
||||
);
|
||||
@ -180,28 +180,27 @@ int main(int argc, char *argv[])
|
||||
- fvc::div(sigmaDotU)
|
||||
);
|
||||
|
||||
h = (rhoE + p)/rho - 0.5*magSqr(U);
|
||||
h.correctBoundaryConditions();
|
||||
e = rhoE/rho - 0.5*magSqr(U);
|
||||
e.correctBoundaryConditions();
|
||||
thermo.correct();
|
||||
rhoE.boundaryField() =
|
||||
rho.boundaryField()*
|
||||
(
|
||||
h.boundaryField() + 0.5*magSqr(U.boundaryField())
|
||||
)
|
||||
- p.boundaryField();
|
||||
e.boundaryField() + 0.5*magSqr(U.boundaryField())
|
||||
);
|
||||
|
||||
if (!inviscid)
|
||||
{
|
||||
volScalarField k("k", thermo.Cp()*mu/Pr);
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, h) - fvc::ddt(rho, h)
|
||||
- fvm::laplacian(thermo.alpha(), h)
|
||||
+ fvc::laplacian(thermo.alpha(), h)
|
||||
fvm::ddt(rho, e) - fvc::ddt(rho, e)
|
||||
- fvm::laplacian(thermo.alpha(), e)
|
||||
+ fvc::laplacian(thermo.alpha(), e)
|
||||
- fvc::laplacian(k, T)
|
||||
);
|
||||
thermo.correct();
|
||||
rhoE = rho*(h + 0.5*magSqr(U)) - p;
|
||||
rhoE = rho*(e + 0.5*magSqr(U));
|
||||
}
|
||||
|
||||
p.dimensionedInternalField() =
|
||||
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "perfectGas.H"
|
||||
|
||||
#include "eConstThermo.H"
|
||||
#include "hConstThermo.H"
|
||||
#include "janafThermo.H"
|
||||
#include "specieThermo.H"
|
||||
|
||||
@ -63,6 +64,24 @@ makeBasicPsiThermo
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeBasicPsiThermo
|
||||
(
|
||||
ePsiThermo,
|
||||
pureMixture,
|
||||
constTransport,
|
||||
hConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeBasicPsiThermo
|
||||
(
|
||||
ePsiThermo,
|
||||
pureMixture,
|
||||
sutherlandTransport,
|
||||
hConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeBasicPsiThermo
|
||||
(
|
||||
ePsiThermo,
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
thermoType ePsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
|
||||
mixture air 1 28.96 1004.5 0 1.458e-06 110.4;
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ FoamFile
|
||||
|
||||
Pr Pr [ 0 0 0 0 0 0 0 ] 0.72;
|
||||
|
||||
thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>;
|
||||
thermoType ePsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>;
|
||||
|
||||
mixture N2 1 28.01348 100 10000 1000 2.9525407 0.0013968838 -4.9262577e-07 7.8600091e-11 -4.6074978e-15 -923.93753 5.8718221 3.5309628 -0.0001236595 -5.0299339e-07 2.4352768e-09 -1.4087954e-12 -1046.9637 2.9674391 1.458e-06 110;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
thermoType ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
|
||||
mixture normalisedGas 1 11640.3 2.5 0 0 1;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
thermoType ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
|
||||
mixture normalisedGas 1 11640.3 2.5 0 0 1;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
thermoType ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
|
||||
mixture air 1 28.96 1004.5 2.544e+06 0 1;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
thermoType ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
|
||||
|
||||
mixture normalisedGas 1 11640.3 2.5 0 0 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user