Commit 602c5875 authored by andy's avatar andy
Browse files

BUG: chemFoam: Calculate the specific gas constant at each time step

- Mantis bug: 315
parent 3b4a9bb6
......@@ -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;
}
}
\ No newline at end of file
}
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment