Commit 5c9f1ea2 authored by mattijs's avatar mattijs
Browse files

allow read restart

parent bd00518f
......@@ -81,23 +81,28 @@ greyDiffusiveRadiationMixedFvPatchScalarField
TName_(dict.lookup("T")),
emissivity_(readScalar(dict.lookup("emissivity")))
{
const scalarField& Tp =
patch().lookupPatchField<volScalarField, scalar>(TName_);
refValue() =
emissivity_*4.0*physicoChemical::sigma.value()*pow4(Tp)/pi;
refGrad() = 0.0;
if (dict.found("value"))
{
fvPatchScalarField::operator=
(
scalarField("value", dict, p.size())
);
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// No value given. Restart as fixedValue b.c.
const scalarField& Tp =
patch().lookupPatchField<volScalarField, scalar>(TName_);
refValue() =
emissivity_*4.0*physicoChemical::sigma.value()*pow4(Tp)/pi;
refGrad() = 0.0;
valueFraction() = 1.0;
fvPatchScalarField::operator=(refValue());
}
}
......@@ -220,10 +225,9 @@ void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::write
Ostream& os
) const
{
fvPatchScalarField::write(os);
mixedFvPatchScalarField::write(os);
os.writeKeyword("T") << TName_ << token::END_STATEMENT << nl;
os.writeKeyword("emissivity") << emissivity_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}
......
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