mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
fixedMultiPhaseHeatFlux: Added optional relaxation
This commit is contained in:
@ -83,10 +83,10 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::yPlusTherm
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
|
||||||
tmp<scalarField> typtf(new scalarField(this->size()));
|
tmp<scalarField> typsf(new scalarField(this->size()));
|
||||||
scalarField& yptf = typtf();
|
scalarField& ypsf = typsf();
|
||||||
|
|
||||||
forAll(yptf, faceI)
|
forAll(ypsf, faceI)
|
||||||
{
|
{
|
||||||
scalar ypt = 11.0;
|
scalar ypt = 11.0;
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::yPlusTherm
|
|||||||
|
|
||||||
if (yptNew < VSMALL)
|
if (yptNew < VSMALL)
|
||||||
{
|
{
|
||||||
yptf[faceI] = 0;
|
ypsf[faceI] = 0;
|
||||||
}
|
}
|
||||||
else if (mag(yptNew - ypt) < tolerance_)
|
else if (mag(yptNew - ypt) < tolerance_)
|
||||||
{
|
{
|
||||||
yptf[faceI] = yptNew;
|
ypsf[faceI] = yptNew;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -110,10 +110,10 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::yPlusTherm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
yptf[faceI] = ypt;
|
ypsf[faceI] = ypt;
|
||||||
}
|
}
|
||||||
|
|
||||||
return typtf;
|
return typsf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -160,52 +160,52 @@ alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
|||||||
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
|
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
|
||||||
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& ptf,
|
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
alphatPhaseChangeWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
alphatPhaseChangeWallFunctionFvPatchScalarField(psf, p, iF, mapper),
|
||||||
Prt_(ptf.Prt_),
|
Prt_(psf.Prt_),
|
||||||
Cmu_(ptf.Cmu_),
|
Cmu_(psf.Cmu_),
|
||||||
kappa_(ptf.kappa_),
|
kappa_(psf.kappa_),
|
||||||
E_(ptf.E_),
|
E_(psf.E_),
|
||||||
dmdtRelax_(ptf.dmdtRelax_),
|
dmdtRelax_(psf.dmdtRelax_),
|
||||||
fixedDmdt_(ptf.fixedDmdt_)
|
fixedDmdt_(psf.fixedDmdt_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
|
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
|
||||||
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& awfpsf
|
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
alphatPhaseChangeWallFunctionFvPatchScalarField(awfpsf),
|
alphatPhaseChangeWallFunctionFvPatchScalarField(psf),
|
||||||
Prt_(awfpsf.Prt_),
|
Prt_(psf.Prt_),
|
||||||
Cmu_(awfpsf.Cmu_),
|
Cmu_(psf.Cmu_),
|
||||||
kappa_(awfpsf.kappa_),
|
kappa_(psf.kappa_),
|
||||||
E_(awfpsf.E_),
|
E_(psf.E_),
|
||||||
dmdtRelax_(awfpsf.dmdtRelax_),
|
dmdtRelax_(psf.dmdtRelax_),
|
||||||
fixedDmdt_(awfpsf.fixedDmdt_)
|
fixedDmdt_(psf.fixedDmdt_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
|
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField::
|
||||||
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& awfpsf,
|
const alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField& psf,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
alphatPhaseChangeWallFunctionFvPatchScalarField(awfpsf, iF),
|
alphatPhaseChangeWallFunctionFvPatchScalarField(psf, iF),
|
||||||
Prt_(awfpsf.Prt_),
|
Prt_(psf.Prt_),
|
||||||
Cmu_(awfpsf.Cmu_),
|
Cmu_(psf.Cmu_),
|
||||||
kappa_(awfpsf.kappa_),
|
kappa_(psf.kappa_),
|
||||||
E_(awfpsf.E_),
|
E_(psf.E_),
|
||||||
dmdtRelax_(awfpsf.dmdtRelax_),
|
dmdtRelax_(psf.dmdtRelax_),
|
||||||
fixedDmdt_(awfpsf.fixedDmdt_)
|
fixedDmdt_(psf.fixedDmdt_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField
|
|||||||
//- E coefficient
|
//- E coefficient
|
||||||
scalar E_;
|
scalar E_;
|
||||||
|
|
||||||
//- dmdt relaxationFactor
|
//- dmdt relaxation factor
|
||||||
scalar dmdtRelax_;
|
scalar dmdtRelax_;
|
||||||
|
|
||||||
//- Reference dmdt
|
//- Reference dmdt
|
||||||
|
|||||||
@ -44,7 +44,8 @@ fixedMultiPhaseHeatFluxFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
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),
|
fixedValueFvPatchScalarField(p, iF, dict),
|
||||||
q_("q", dict, p.size())
|
q_("q", dict, p.size()),
|
||||||
|
relax_(dict.lookupOrDefault<scalar>("relax", 1.0))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
|
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
|
||||||
fixedMultiPhaseHeatFluxFvPatchScalarField
|
fixedMultiPhaseHeatFluxFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fixedMultiPhaseHeatFluxFvPatchScalarField& ptf,
|
const fixedMultiPhaseHeatFluxFvPatchScalarField& psf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
fixedValueFvPatchScalarField(psf, p, iF, mapper),
|
||||||
q_(ptf.q_, mapper)
|
q_(psf.q_, mapper),
|
||||||
|
relax_(psf.relax_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
|
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
|
||||||
fixedMultiPhaseHeatFluxFvPatchScalarField
|
fixedMultiPhaseHeatFluxFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fixedMultiPhaseHeatFluxFvPatchScalarField& awfpsf
|
const fixedMultiPhaseHeatFluxFvPatchScalarField& psf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(awfpsf),
|
fixedValueFvPatchScalarField(psf),
|
||||||
q_(awfpsf.q_)
|
q_(psf.q_),
|
||||||
|
relax_(psf.relax_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
|
Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::
|
||||||
fixedMultiPhaseHeatFluxFvPatchScalarField
|
fixedMultiPhaseHeatFluxFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fixedMultiPhaseHeatFluxFvPatchScalarField& awfpsf,
|
const fixedMultiPhaseHeatFluxFvPatchScalarField& psf,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(awfpsf, iF),
|
fixedValueFvPatchScalarField(psf, iF),
|
||||||
q_(awfpsf.q_)
|
q_(psf.q_),
|
||||||
|
relax_(psf.relax_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -165,8 +170,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
|
|||||||
<< gMin(Q) << " - " << gMax(Q) << endl;
|
<< 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();
|
fixedValueFvPatchScalarField::updateCoeffs();
|
||||||
}
|
}
|
||||||
@ -175,6 +179,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
|
|||||||
void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const
|
void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
|
os.writeKeyword("relax") << relax_ << token::END_STATEMENT << nl;
|
||||||
q_.writeEntry("q", os);
|
q_.writeEntry("q", os);
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,6 +67,9 @@ class fixedMultiPhaseHeatFluxFvPatchScalarField
|
|||||||
//- Heat power [W] or flux [W/m2]
|
//- Heat power [W] or flux [W/m2]
|
||||||
scalarField q_;
|
scalarField q_;
|
||||||
|
|
||||||
|
//- Relaxation factor
|
||||||
|
scalar relax_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user