liquidProperties: Simplified dictionary format
The defaultCoeffs entry is now redundant and supported only for backward
compatibility. To specify a liquid with default coefficients simply leave the
coefficients dictionary empty:
liquids
{
H2O {}
}
Any or all of the coefficients may be overridden by specifying the properties in
the coefficients dictionary, e.g.
liquids
{
H2O
{
rho
{
a 1000;
b 0;
c 0;
d 0;
}
}
}
This commit is contained in:
@ -97,6 +97,10 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New
|
|||||||
|
|
||||||
const word& liquidPropertiesTypeName = dict.dictName();
|
const word& liquidPropertiesTypeName = dict.dictName();
|
||||||
|
|
||||||
|
if (dict.found("defaultCoeffs"))
|
||||||
|
{
|
||||||
|
// Backward-compatibility
|
||||||
|
|
||||||
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
|
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
|
||||||
|
|
||||||
if (defaultCoeffs)
|
if (defaultCoeffs)
|
||||||
@ -137,6 +141,24 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dictionaryConstructorTable::iterator cstrIter =
|
||||||
|
dictionaryConstructorTablePtr_->find(liquidPropertiesTypeName);
|
||||||
|
|
||||||
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "Unknown liquidProperties type "
|
||||||
|
<< liquidPropertiesTypeName << nl << nl
|
||||||
|
<< "Valid liquidProperties types are:" << nl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<liquidProperties>(cstrIter()(dict));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -144,91 +166,91 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New
|
|||||||
Foam::scalar Foam::liquidProperties::rho(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::rho(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::pv(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::pv(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::hl(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::hl(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::Cp(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::Cp(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::h(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::h(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::Cpg(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::Cpg(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::mu(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::mu(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::mug(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::mug(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::kappa(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::kappa(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::kappag(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::kappag(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::sigma(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::sigma(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::D(scalar p, scalar T) const
|
Foam::scalar Foam::liquidProperties::D(scalar p, scalar T) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidProperties::D(scalar p, scalar T, scalar Wb) const
|
Foam::scalar Foam::liquidProperties::D(scalar p, scalar T, scalar Wb) const
|
||||||
{
|
{
|
||||||
NotImplemented;
|
NotImplemented;
|
||||||
return 0.0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -259,7 +281,7 @@ Foam::scalar Foam::liquidProperties::pvInvert(scalar p) const
|
|||||||
|
|
||||||
while ((Thi - Tlo) > 1.0e-4)
|
while ((Thi - Tlo) > 1.0e-4)
|
||||||
{
|
{
|
||||||
if ((pv(p, T) - p) <= 0.0)
|
if ((pv(p, T) - p) <= 0)
|
||||||
{
|
{
|
||||||
Tlo = T;
|
Tlo = T;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,8 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New
|
|||||||
}
|
}
|
||||||
|
|
||||||
const word solidType(dict.dictName());
|
const word solidType(dict.dictName());
|
||||||
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
|
|
||||||
|
|
||||||
if (defaultCoeffs)
|
if (!dict.found("defaultCoeffs") || Switch(dict.lookup("defaultCoeffs")))
|
||||||
{
|
{
|
||||||
ConstructorTable::iterator cstrIter =
|
ConstructorTable::iterator cstrIter =
|
||||||
ConstructorTablePtr_->find(solidType);
|
ConstructorTablePtr_->find(solidType);
|
||||||
|
|||||||
@ -36,13 +36,10 @@ foamChemistryFile "$FOAM_CASE/constant/reactions";
|
|||||||
|
|
||||||
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
|
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
|
||||||
|
|
||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O
|
||||||
{
|
{}
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
|
|||||||
@ -36,10 +36,7 @@ inertSpecie N2;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
@ -47,7 +44,7 @@ solids
|
|||||||
C
|
C
|
||||||
{
|
{
|
||||||
defaultCoeffs no;
|
defaultCoeffs no;
|
||||||
// if defaultCoeffs no properties should be :
|
|
||||||
CCoeffs
|
CCoeffs
|
||||||
{
|
{
|
||||||
rho 2010;
|
rho 2010;
|
||||||
@ -57,10 +54,8 @@ solids
|
|||||||
emissivity 1.0;
|
emissivity 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ash
|
|
||||||
{
|
ash {}
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -36,16 +36,11 @@ inertSpecie N2;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,16 +36,11 @@ inertSpecie N2;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,16 +36,11 @@ inertSpecie N2;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,16 +36,11 @@ inertSpecie N2;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,16 +36,11 @@ foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly";
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
inertSpecie N2;
|
inertSpecie N2;
|
||||||
|
|
||||||
|
|||||||
@ -38,16 +38,11 @@ inertSpecie air;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -38,16 +38,11 @@ inertSpecie air;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,18 +36,14 @@ inertSpecie air;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
// de-activate the pressure-work term when running local time-stepping
|
// de-activate the pressure-work term when running local time-stepping
|
||||||
dpdt no;
|
dpdt no;
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,16 +36,11 @@ inertSpecie air;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
H2O
|
H2O {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,15 +36,11 @@ inertSpecie N2;
|
|||||||
|
|
||||||
liquids
|
liquids
|
||||||
{
|
{
|
||||||
C7H16
|
C7H16 {}
|
||||||
{
|
|
||||||
defaultCoeffs yes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
solids
|
solids
|
||||||
{
|
{}
|
||||||
// none
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user