Commit 9b4f327e authored by Henry Weller's avatar Henry Weller
Browse files

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;
            }
        }
    }
parent a6fd99b8
......@@ -97,24 +97,49 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New
const word& liquidPropertiesTypeName = dict.dictName();
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
if (defaultCoeffs)
if (dict.found("defaultCoeffs"))
{
ConstructorTable::iterator cstrIter =
ConstructorTablePtr_->find(liquidPropertiesTypeName);
// Backward-compatibility
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
if (cstrIter == ConstructorTablePtr_->end())
if (defaultCoeffs)
{
FatalErrorInFunction
<< "Unknown liquidProperties type "
<< liquidPropertiesTypeName << nl << nl
<< "Valid liquidProperties types are:" << nl
<< ConstructorTablePtr_->sortedToc()
<< abort(FatalError);
ConstructorTable::iterator cstrIter =
ConstructorTablePtr_->find(liquidPropertiesTypeName);
if (cstrIter == ConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown liquidProperties type "
<< liquidPropertiesTypeName << nl << nl
<< "Valid liquidProperties types are:" << nl
<< ConstructorTablePtr_->sortedToc()
<< abort(FatalError);
}
return autoPtr<liquidProperties>(cstrIter()());
}
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.subDict(liquidPropertiesTypeName + "Coeffs"))
);
}
return autoPtr<liquidProperties>(cstrIter()());
}
else
{
......@@ -131,10 +156,7 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New
<< abort(FatalError);
}
return autoPtr<liquidProperties>
(
cstrIter()(dict.subDict(liquidPropertiesTypeName + "Coeffs"))
);
return autoPtr<liquidProperties>(cstrIter()(dict));
}
}
......@@ -144,91 +166,91 @@ Foam::autoPtr<Foam::liquidProperties> Foam::liquidProperties::New
Foam::scalar Foam::liquidProperties::rho(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::pv(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::hl(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::Cp(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::h(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::Cpg(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::mu(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::mug(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::kappa(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::kappag(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::sigma(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::D(scalar p, scalar T) const
{
NotImplemented;
return 0.0;
return 0;
}
Foam::scalar Foam::liquidProperties::D(scalar p, scalar T, scalar Wb) const
{
NotImplemented;
return 0.0;
return 0;
}
......@@ -259,7 +281,7 @@ Foam::scalar Foam::liquidProperties::pvInvert(scalar p) const
while ((Thi - Tlo) > 1.0e-4)
{
if ((pv(p, T) - p) <= 0.0)
if ((pv(p, T) - p) <= 0)
{
Tlo = T;
}
......
......@@ -39,9 +39,8 @@ Foam::autoPtr<Foam::solidProperties> Foam::solidProperties::New
}
const word solidType(dict.dictName());
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
if (defaultCoeffs)
if (!dict.found("defaultCoeffs") || Switch(dict.lookup("defaultCoeffs")))
{
ConstructorTable::iterator cstrIter =
ConstructorTablePtr_->find(solidType);
......
......@@ -36,13 +36,10 @@ foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
liquids
{
H2O
{
defaultCoeffs yes;
}
{}
}
solids
......
......@@ -36,10 +36,7 @@ inertSpecie N2;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
......@@ -47,7 +44,7 @@ solids
C
{
defaultCoeffs no;
// if defaultCoeffs no properties should be :
CCoeffs
{
rho 2010;
......@@ -57,10 +54,8 @@ solids
emissivity 1.0;
}
}
ash
{
defaultCoeffs yes;
}
ash {}
}
......
......@@ -36,16 +36,11 @@ inertSpecie N2;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// ************************************************************************* //
......@@ -36,16 +36,11 @@ inertSpecie N2;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// ************************************************************************* //
......@@ -36,16 +36,11 @@ inertSpecie N2;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// ************************************************************************* //
......@@ -36,16 +36,11 @@ inertSpecie N2;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// ************************************************************************* //
......@@ -36,16 +36,11 @@ foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly";
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
inertSpecie N2;
......
......@@ -38,16 +38,11 @@ inertSpecie air;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// ************************************************************************* //
......@@ -38,16 +38,11 @@ inertSpecie air;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// ************************************************************************* //
......@@ -36,18 +36,14 @@ inertSpecie air;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// de-activate the pressure-work term when running local time-stepping
dpdt no;
// ************************************************************************* //
......@@ -36,16 +36,11 @@ inertSpecie air;
liquids
{
H2O
{
defaultCoeffs yes;
}
H2O {}
}
solids
{
// none
}
{}
// ************************************************************************* //
......@@ -36,15 +36,11 @@ inertSpecie N2;
liquids
{
C7H16
{
defaultCoeffs yes;
}
C7H16 {}
}
solids
{
// none
}
{}
// ************************************************************************* //
Supports Markdown
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