Commit c40faa99 authored by Henry Weller's avatar Henry Weller
Browse files

fixedMultiPhaseHeatFlux: Added optional relaxation

parent 346b31d9
......@@ -83,10 +83,10 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::yPlusTherm
) const
{
tmp<scalarField> typtf(new scalarField(this->size()));
scalarField& yptf = typtf();
tmp<scalarField> typsf(new scalarField(this->size()));
scalarField& ypsf = typsf();
forAll(yptf, faceI)
forAll(ypsf, faceI)
{
scalar ypt = 11.0;
......@@ -98,11 +98,11 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::yPlusTherm
if (yptNew < VSMALL)
{
yptf[faceI] = 0;
ypsf[faceI] = 0;
}
else if (mag(yptNew - ypt) < tolerance_)
{
yptf[faceI] = yptNew;
ypsf[faceI] = yptNew;
}
else
{
......@@ -110,10 +110,10 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::yPlusTherm
}
}
yptf[faceI] = ypt;
ypsf[faceI] = ypt;
}
return typtf;
return typsf;
}
......@@ -160,52 +160,52 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
(
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& ptf,
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
alphatPhaseChangeWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
Prt_(ptf.Prt_),
Cmu_(ptf.Cmu_),
kappa_(ptf.kappa_),
E_(ptf.E_),
dmdtRelax_(ptf.dmdtRelax_),
fixedDmdt_(ptf.fixedDmdt_)
alphatPhaseChangeWallFunctionFvPatchScalarField(psf, p, iF, mapper),
Prt_(psf.Prt_),
Cmu_(psf.Cmu_),
kappa_(psf.kappa_),
E_(psf.E_),
dmdtRelax_(psf.dmdtRelax_),
fixedDmdt_(psf.fixedDmdt_)
{}
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
(
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& awfpsf
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf
)
:
alphatPhaseChangeWallFunctionFvPatchScalarField(awfpsf),
Prt_(awfpsf.Prt_),
Cmu_(awfpsf.Cmu_),
kappa_(awfpsf.kappa_),
E_(awfpsf.E_),
dmdtRelax_(awfpsf.dmdtRelax_),
fixedDmdt_(awfpsf.fixedDmdt_)
alphatPhaseChangeWallFunctionFvPatchScalarField(psf),
Prt_(psf.Prt_),
Cmu_(psf.Cmu_),
kappa_(psf.kappa_),
E_(psf.E_),
dmdtRelax_(psf.dmdtRelax_),
fixedDmdt_(psf.fixedDmdt_)
{}
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
(
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& awfpsf,
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
const DimensionedField<scalar, volMesh>& iF
)
:
alphatPhaseChangeWallFunctionFvPatchScalarField(awfpsf, iF),
Prt_(awfpsf.Prt_),
Cmu_(awfpsf.Cmu_),
kappa_(awfpsf.kappa_),
E_(awfpsf.E_),
dmdtRelax_(awfpsf.dmdtRelax_),
fixedDmdt_(awfpsf.fixedDmdt_)
alphatPhaseChangeWallFunctionFvPatchScalarField(psf, iF),
Prt_(psf.Prt_),
Cmu_(psf.Cmu_),
kappa_(psf.kappa_),
E_(psf.E_),
dmdtRelax_(psf.dmdtRelax_),
fixedDmdt_(psf.fixedDmdt_)
{}
......
......@@ -73,7 +73,7 @@ class alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
//- E coefficient
scalar E_;
//- dmdt relaxationFactor
//- dmdt relaxation factor
scalar dmdtRelax_;
//- Reference dmdt
......
......@@ -44,7 +44,8 @@ fixedMultiPhaseHeatFluxFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
q_(p.size(), 0.0)
q_(p.size(), 0.0),
relax_(1.0)
{}
......@@ -57,44 +58,48 @@ fixedMultiPhaseHeatFluxFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF, dict),
q_("q", dict, p.size())
q_("q", dict, p.size()),
relax_(dict.lookupOrDefault<scalar>("relax", 1.0))
{}
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
fixedMultiPhaseHeatFluxFvPatchScalarField
(
const fixedMultiPhaseHeatFluxFvPatchScalarField& ptf,
const fixedMultiPhaseHeatFluxFvPatchScalarField& psf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
q_(ptf.q_, mapper)
fixedValueFvPatchScalarField(psf, p, iF, mapper),
q_(psf.q_, mapper),
relax_(psf.relax_)
{}
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
fixedMultiPhaseHeatFluxFvPatchScalarField
(
const fixedMultiPhaseHeatFluxFvPatchScalarField& awfpsf
const fixedMultiPhaseHeatFluxFvPatchScalarField& psf
)
:
fixedValueFvPatchScalarField(awfpsf),
q_(awfpsf.q_)
fixedValueFvPatchScalarField(psf),
q_(psf.q_),
relax_(psf.relax_)
{}
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
fixedMultiPhaseHeatFluxFvPatchScalarField
(
const fixedMultiPhaseHeatFluxFvPatchScalarField& awfpsf,
const fixedMultiPhaseHeatFluxFvPatchScalarField& psf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(awfpsf, iF),
q_(awfpsf.q_)
fixedValueFvPatchScalarField(psf, iF),
q_(psf.q_),
relax_(psf.relax_)
{}
......@@ -165,8 +170,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
<< gMin(Q) << " - " << gMax(Q) << endl;
}
scalar relax(1);
operator==((1 - relax)*Tp + relax*(q_ + A)/(B));
operator==((1 - relax_)*Tp + relax_*(q_ + A)/(B));
fixedValueFvPatchScalarField::updateCoeffs();
}
......@@ -175,6 +179,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl;
q_.writeEntry("q", os);
writeEntry("value", os);
}
......
......@@ -67,6 +67,9 @@ class fixedMultiPhaseHeatFluxFvPatchScalarField
//- Heat power [W] or flux [W/m2]
scalarField q_;
//- Relaxation factor
scalar relax_;
public:
......
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