Bugfix: rothalpy boundary condition handling. Ilaria De Dominicis
This commit is contained in:
parent
d1bbe88582
commit
451aa81a39
3 changed files with 139 additions and 5 deletions
|
@ -115,6 +115,44 @@ void Foam::fixedEnthalpyFvPatchScalarField::updateCoeffs()
|
|||
dimensionedInternalField().name() == db().mangleFileName("i")
|
||||
)
|
||||
{
|
||||
// Get access to relative and rotational velocity
|
||||
const word UrelName("Urel");
|
||||
const word UrotName("Urot");
|
||||
|
||||
if
|
||||
(
|
||||
!this->db().objectRegistry::found(UrelName)
|
||||
|| !this->db().objectRegistry::found(UrotName)
|
||||
)
|
||||
{
|
||||
// Velocities not available, do not update
|
||||
InfoIn
|
||||
(
|
||||
"void gradientEnthalpyFvPatchScalarField::"
|
||||
"updateCoeffs(const vectorField& Up)"
|
||||
) << "Velocity fields " << UrelName << " or "
|
||||
<< UrotName << " not found. "
|
||||
<< "Performing enthalpy value update for field "
|
||||
<< this->dimensionedInternalField().name()
|
||||
<< " and patch " << patchi
|
||||
<< endl;
|
||||
|
||||
operator==(thermo.h(Tw, patchi));
|
||||
}
|
||||
else
|
||||
{
|
||||
const fvPatchVectorField& Urelp =
|
||||
lookupPatchField<volVectorField, vector>(UrelName);
|
||||
|
||||
const fvPatchVectorField& Urotp =
|
||||
lookupPatchField<volVectorField, vector>(UrotName);
|
||||
|
||||
operator==
|
||||
(
|
||||
thermo.h(Tw, patchi)
|
||||
- 0.5*(magSqr(Urotp) - magSqr(Urelp))
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -121,6 +121,52 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs()
|
|||
dimensionedInternalField().name() == db().mangleFileName("i")
|
||||
)
|
||||
{
|
||||
// Get access to relative and rotational velocity
|
||||
const word UrelName("Urel");
|
||||
const word UrotName("Urot");
|
||||
|
||||
if
|
||||
(
|
||||
!this->db().objectRegistry::found(UrelName)
|
||||
|| !this->db().objectRegistry::found(UrotName)
|
||||
)
|
||||
{
|
||||
// Velocities not available, do not update
|
||||
InfoIn
|
||||
(
|
||||
"void gradientEnthalpyFvPatchScalarField::"
|
||||
"updateCoeffs(const vectorField& Up)"
|
||||
) << "Velocity fields " << UrelName << " or "
|
||||
<< UrotName << " not found. "
|
||||
<< "Performing enthalpy value update for field "
|
||||
<< this->dimensionedInternalField().name()
|
||||
<< " and patch " << patchi
|
||||
<< endl;
|
||||
|
||||
gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad()
|
||||
+ patch().deltaCoeffs()*
|
||||
(
|
||||
thermo.h(Tw, patchi)
|
||||
- thermo.h(Tw, patch().faceCells())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const fvPatchVectorField& Urelp =
|
||||
lookupPatchField<volVectorField, vector>(UrelName);
|
||||
|
||||
const fvPatchVectorField& Urotp =
|
||||
lookupPatchField<volVectorField, vector>(UrotName);
|
||||
|
||||
gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad()
|
||||
+ patch().deltaCoeffs()*
|
||||
(
|
||||
thermo.h(Tw, patchi)
|
||||
- thermo.h(Tw, patch().faceCells())
|
||||
)
|
||||
- mag(Urotp)*mag(Urotp.snGrad())
|
||||
+ mag(Urelp)*mag(Urelp.snGrad());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -130,6 +130,56 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs()
|
|||
dimensionedInternalField().name() == db().mangleFileName("i")
|
||||
)
|
||||
{
|
||||
// Get access to relative and rotational velocity
|
||||
const word UrelName("Urel");
|
||||
const word UrotName("Urot");
|
||||
|
||||
if
|
||||
(
|
||||
!this->db().objectRegistry::found(UrelName)
|
||||
|| !this->db().objectRegistry::found(UrotName)
|
||||
)
|
||||
{
|
||||
// Velocities not available, do not update
|
||||
InfoIn
|
||||
(
|
||||
"void gradientEnthalpyFvPatchScalarField::"
|
||||
"updateCoeffs(const vectorField& Up)"
|
||||
) << "Velocity fields " << UrelName << " or "
|
||||
<< UrotName << " not found. "
|
||||
<< "Performing enthalpy value update for field "
|
||||
<< this->dimensionedInternalField().name()
|
||||
<< " and patch " << patchi
|
||||
<< endl;
|
||||
|
||||
refValue() = thermo.h(Tw.refValue(), patchi);
|
||||
refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
|
||||
+ patch().deltaCoeffs()*
|
||||
(
|
||||
thermo.h(Tw, patchi)
|
||||
- thermo.h(Tw, patch().faceCells())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const fvPatchVectorField& Urelp =
|
||||
lookupPatchField<volVectorField, vector>(UrelName);
|
||||
|
||||
const fvPatchVectorField& Urotp =
|
||||
lookupPatchField<volVectorField, vector>(UrotName);
|
||||
|
||||
refValue() = thermo.h(Tw.refValue(), patchi)
|
||||
- 0.5*(magSqr(Urotp) - magSqr(Urelp));
|
||||
|
||||
refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
|
||||
+ patch().deltaCoeffs()*
|
||||
(
|
||||
thermo.h(Tw, patchi)
|
||||
- thermo.h(Tw, patch().faceCells())
|
||||
)
|
||||
- mag(Urotp)*mag(Urotp.snGrad())
|
||||
+ mag(Urelp)*mag(Urelp.snGrad());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Reference in a new issue