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

- Mantis bug: 315
This commit is contained in:
andy
2011-10-21 11:37:57 +01:00
parent 3b4a9bb60e
commit 602c5875e2
3 changed files with 32 additions and 3 deletions

View File

@ -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

View File

@ -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;
}
}
}

View 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;