BUG: basicThermo: enforcing shared T. Fixes #887.

This commit is contained in:
mattijs
2018-06-20 12:07:00 +01:00
committed by Andrew Heather
parent 636328fc1c
commit 3603cf289f
2 changed files with 63 additions and 29 deletions

View File

@ -178,28 +178,12 @@ Foam::basicThermo::basicThermo
const fvMesh& mesh, const fvMesh& mesh,
const word& phaseName const word& phaseName
) )
:
basicThermo
(
mesh,
phaseName,
phasePropertyName(dictName, phaseName)
)
{}
Foam::basicThermo::basicThermo
(
const fvMesh& mesh,
const word& phaseName,
const word& dictionaryName
)
: :
IOdictionary IOdictionary
( (
IOobject IOobject
( (
dictionaryName, phasePropertyName(dictName, phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
@ -234,16 +218,7 @@ Foam::basicThermo::basicThermo
), ),
dpdt_(lookupOrDefault<Switch>("dpdt", true)) dpdt_(lookupOrDefault<Switch>("dpdt", true))
{ {}
if (debug)
{
Pout<< "Constructed thermo : mesh:" << mesh.name()
<< " phase:" << phaseName
<< " dictionary:" << dictionaryName
<< " alphaName:" << alpha_.name()
<< " updateT:" << TOwner_ << endl;
}
}
Foam::basicThermo::basicThermo Foam::basicThermo::basicThermo
@ -294,6 +269,66 @@ Foam::basicThermo::basicThermo
{} {}
Foam::basicThermo::basicThermo
(
const fvMesh& mesh,
const word& phaseName,
const word& dictionaryName
)
:
IOdictionary
(
IOobject
(
dictionaryName,
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
phaseName_(phaseName),
p_(lookupOrConstruct(mesh, "p", pOwner_)),
T_(lookupOrConstruct(mesh, "T", TOwner_)),
TOwner_(lookupOrDefault<Switch>("updateT", TOwner_)),
alpha_
(
IOobject
(
"thermo:alpha",
mesh.time().timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar
(
"zero",
dimensionSet(1, -1, -1, 0, 0),
Zero
)
),
dpdt_(lookupOrDefault<Switch>("dpdt", true))
{
if (debug)
{
Pout<< "Constructed shared thermo : mesh:" << mesh.name()
<< " phase:" << phaseName
<< " dictionary:" << dictionaryName
<< " T:" << T_.name()
<< " updateT:" << TOwner_
<< " alphaName:" << alpha_.name()
<< endl;
}
}
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New

View File

@ -15,8 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoReactingMultiphaseInterFoam;
application icoReactingMultiPhaseInterFoam;
startFrom latestTime; startFrom latestTime;