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();
|
basicPsiThermo& thermo = pThermo();
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& h = thermo.h();
|
volScalarField& e = thermo.e();
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
const volScalarField& psi = thermo.psi();
|
const volScalarField& psi = thermo.psi();
|
||||||
const volScalarField& mu = thermo.mu();
|
const volScalarField& mu = thermo.mu();
|
||||||
@ -70,7 +70,7 @@ volScalarField rhoE
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
rho*(h + 0.5*magSqr(U)) - p
|
rho*(e + 0.5*magSqr(U))
|
||||||
);
|
);
|
||||||
|
|
||||||
surfaceScalarField pos
|
surfaceScalarField pos
|
||||||
|
|||||||
@ -76,10 +76,10 @@ int main(int argc, char *argv[])
|
|||||||
surfaceScalarField rPsi_neg =
|
surfaceScalarField rPsi_neg =
|
||||||
fvc::interpolate(rPsi, neg, "reconstruct(T)");
|
fvc::interpolate(rPsi, neg, "reconstruct(T)");
|
||||||
|
|
||||||
surfaceScalarField h_pos =
|
surfaceScalarField e_pos =
|
||||||
fvc::interpolate(h, pos, "reconstruct(T)");
|
fvc::interpolate(e, pos, "reconstruct(T)");
|
||||||
surfaceScalarField h_neg =
|
surfaceScalarField e_neg =
|
||||||
fvc::interpolate(h, neg, "reconstruct(T)");
|
fvc::interpolate(e, neg, "reconstruct(T)");
|
||||||
|
|
||||||
surfaceVectorField U_pos = rhoU_pos/rho_pos;
|
surfaceVectorField U_pos = rhoU_pos/rho_pos;
|
||||||
surfaceVectorField U_neg = rhoU_neg/rho_neg;
|
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();
|
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf();
|
||||||
|
|
||||||
surfaceScalarField phiEp =
|
surfaceScalarField phiEp =
|
||||||
aphiv_pos*rho_pos*(h_pos + 0.5*magSqr(U_pos))
|
aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
|
||||||
+ aphiv_neg*rho_neg*(h_neg + 0.5*magSqr(U_neg))
|
+ aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
|
||||||
+ aSf*p_pos - aSf*p_neg;
|
+ aSf*p_pos - aSf*p_neg;
|
||||||
|
|
||||||
volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T()));
|
volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T()));
|
||||||
@ -156,7 +156,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
solve
|
solve
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, U) - fvc::ddt(rho,U)
|
fvm::ddt(rho, U) - fvc::ddt(rho, U)
|
||||||
- fvm::laplacian(mu, U)
|
- fvm::laplacian(mu, U)
|
||||||
- fvc::div(tauMC)
|
- fvc::div(tauMC)
|
||||||
);
|
);
|
||||||
@ -180,28 +180,27 @@ int main(int argc, char *argv[])
|
|||||||
- fvc::div(sigmaDotU)
|
- fvc::div(sigmaDotU)
|
||||||
);
|
);
|
||||||
|
|
||||||
h = (rhoE + p)/rho - 0.5*magSqr(U);
|
e = rhoE/rho - 0.5*magSqr(U);
|
||||||
h.correctBoundaryConditions();
|
e.correctBoundaryConditions();
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
rhoE.boundaryField() =
|
rhoE.boundaryField() =
|
||||||
rho.boundaryField()*
|
rho.boundaryField()*
|
||||||
(
|
(
|
||||||
h.boundaryField() + 0.5*magSqr(U.boundaryField())
|
e.boundaryField() + 0.5*magSqr(U.boundaryField())
|
||||||
)
|
);
|
||||||
- p.boundaryField();
|
|
||||||
|
|
||||||
if (!inviscid)
|
if (!inviscid)
|
||||||
{
|
{
|
||||||
volScalarField k("k", thermo.Cp()*mu/Pr);
|
volScalarField k("k", thermo.Cp()*mu/Pr);
|
||||||
solve
|
solve
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, h) - fvc::ddt(rho, h)
|
fvm::ddt(rho, e) - fvc::ddt(rho, e)
|
||||||
- fvm::laplacian(thermo.alpha(), h)
|
- fvm::laplacian(thermo.alpha(), e)
|
||||||
+ fvc::laplacian(thermo.alpha(), h)
|
+ fvc::laplacian(thermo.alpha(), e)
|
||||||
- fvc::laplacian(k, T)
|
- fvc::laplacian(k, T)
|
||||||
);
|
);
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
rhoE = rho*(h + 0.5*magSqr(U)) - p;
|
rhoE = rho*(e + 0.5*magSqr(U));
|
||||||
}
|
}
|
||||||
|
|
||||||
p.dimensionedInternalField() =
|
p.dimensionedInternalField() =
|
||||||
|
|||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "perfectGas.H"
|
#include "perfectGas.H"
|
||||||
|
|
||||||
#include "eConstThermo.H"
|
#include "eConstThermo.H"
|
||||||
|
#include "hConstThermo.H"
|
||||||
#include "janafThermo.H"
|
#include "janafThermo.H"
|
||||||
#include "specieThermo.H"
|
#include "specieThermo.H"
|
||||||
|
|
||||||
@ -63,6 +64,24 @@ makeBasicPsiThermo
|
|||||||
perfectGas
|
perfectGas
|
||||||
);
|
);
|
||||||
|
|
||||||
|
makeBasicPsiThermo
|
||||||
|
(
|
||||||
|
ePsiThermo,
|
||||||
|
pureMixture,
|
||||||
|
constTransport,
|
||||||
|
hConstThermo,
|
||||||
|
perfectGas
|
||||||
|
);
|
||||||
|
|
||||||
|
makeBasicPsiThermo
|
||||||
|
(
|
||||||
|
ePsiThermo,
|
||||||
|
pureMixture,
|
||||||
|
sutherlandTransport,
|
||||||
|
hConstThermo,
|
||||||
|
perfectGas
|
||||||
|
);
|
||||||
|
|
||||||
makeBasicPsiThermo
|
makeBasicPsiThermo
|
||||||
(
|
(
|
||||||
ePsiThermo,
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
mixture normalisedGas 1 11640.3 2.5 0 0 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user