Skip to content
Snippets Groups Projects
Commit 5eed2863 authored by Sergio Ferraris's avatar Sergio Ferraris
Browse files

ENH: Adding gradient() and value() field reading from full restart for

buoyantPressureFvPatchScalarField and writing value() field for
fixedFluxPressureFvPatchScalarField
parent 35487d3b
Branches
Tags
No related merge requests found
......@@ -55,8 +55,19 @@ buoyantPressureFvPatchScalarField
fixedGradientFvPatchScalarField(p, iF),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchField<scalar>::operator=(patchInternalField());
gradient() = 0.0;
if (dict.found("value") && dict.found("gradient"))
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
gradient() = scalarField("gradient", dict, p.size());
}
else
{
fvPatchField<scalar>::operator=(patchInternalField());
gradient() = 0.0;
}
}
......
......@@ -77,11 +77,15 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
DpName_(dict.lookupOrDefault<word>("Dp", "Dp")),
adjoint_(dict.lookupOrDefault<Switch>("adjoint", false))
{
if (dict.found("gradient"))
if (dict.found("value") && dict.found("gradient"))
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
gradient() = scalarField("gradient", dict, p.size());
fixedGradientFvPatchScalarField::updateCoeffs();
fixedGradientFvPatchScalarField::evaluate();
//fixedGradientFvPatchScalarField::updateCoeffs();
//fixedGradientFvPatchScalarField::evaluate();
}
else
{
......@@ -190,7 +194,7 @@ void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
fixedGradientFvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "phiHbyA", "phiHbyA", phiHbyAName_);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
......@@ -200,6 +204,7 @@ void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
os.writeKeyword("adjoint") << adjoint_ << token::END_STATEMENT << nl;
}
gradient().writeEntry("gradient", os);
writeEntry("value", os);
}
......
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