mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: chemFoam: Calculate the specific gas constant at each time step
- Mantis bug: 315
This commit is contained in:
@ -45,9 +45,29 @@
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& hs = thermo.hs();
|
||||
|
||||
volScalarField Rspecific
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Rspecific",
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar
|
||||
(
|
||||
"zero",
|
||||
dimensionSet(dimEnergy/dimMass/dimTemperature),
|
||||
0.0
|
||||
)
|
||||
);
|
||||
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
|
||||
@ -3,7 +3,15 @@
|
||||
rho = thermo.rho();
|
||||
if (constProp == "volume")
|
||||
{
|
||||
p[0] = rho0*R0*thermo.T()[0];
|
||||
scalar invW = 0.0;
|
||||
forAll(Y, i)
|
||||
{
|
||||
invW += Y[i][0]/specieData[i].W();
|
||||
}
|
||||
|
||||
Rspecific[0] = 1000.0*constant::physicoChemical::R.value()*invW;
|
||||
|
||||
p[0] = rho0*Rspecific[0]*thermo.T()[0];
|
||||
rho[0] = rho0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,6 +106,7 @@
|
||||
scalar rho0 = rho[0];
|
||||
scalar u0 = hs0 - p0/rho0;
|
||||
scalar R0 = p0/(rho0*T0);
|
||||
|
||||
Rspecific[0] = R0;
|
||||
|
||||
scalar integratedHeat = 0.0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user