uniformFixedMultiphaseHeatFluxFvPatchScalarField: Added fixesValue() returning false
so that the energy-> temperature conversion in *heThermo updates the wall temperature.
This commit is contained in:
@ -42,11 +42,11 @@ uniformFixedMultiphaseHeatFluxFvPatchScalarField
|
|||||||
q_(Function1<scalar>::New("q", dict)),
|
q_(Function1<scalar>::New("q", dict)),
|
||||||
relax_(dict.lookupOrDefault<scalar>("relax", 1))
|
relax_(dict.lookupOrDefault<scalar>("relax", 1))
|
||||||
{
|
{
|
||||||
|
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||||
|
|
||||||
valueFraction() = 1;
|
valueFraction() = 1;
|
||||||
refValue() = patchInternalField();
|
refValue() = patchInternalField();
|
||||||
refGrad() = Zero;
|
refGrad() = Zero;
|
||||||
|
|
||||||
operator==(patchInternalField());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -97,9 +97,9 @@ void Foam::uniformFixedMultiphaseHeatFluxFvPatchScalarField::updateCoeffs()
|
|||||||
const phaseModel& thisPhase = fluid.phases()[internalField().group()];
|
const phaseModel& thisPhase = fluid.phases()[internalField().group()];
|
||||||
|
|
||||||
// Sums of alpha*kappaEff
|
// Sums of alpha*kappaEff
|
||||||
scalarField sumAlphaKappaEff(patch().size(), rootVSmall);
|
scalarField sumNotThisAlphaKappaEff(patch().size(), 0);
|
||||||
scalarField sumNotThisAlphaKappaEff(patch().size(), rootVSmall);
|
scalarField sumNotThisAlphaKappaEffT(patch().size(), 0);
|
||||||
scalarField sumNotThisAlphaKappaEffT(patch().size(), rootVSmall);
|
scalarField sumNotThisAlphaKappaEffTw(patch().size(), 0);
|
||||||
|
|
||||||
// Contributions from phases other than this one
|
// Contributions from phases other than this one
|
||||||
forAll(fluid.phases(), phasei)
|
forAll(fluid.phases(), phasei)
|
||||||
@ -114,9 +114,9 @@ void Foam::uniformFixedMultiphaseHeatFluxFvPatchScalarField::updateCoeffs()
|
|||||||
const fvPatchScalarField& T =
|
const fvPatchScalarField& T =
|
||||||
phase.thermo().T().boundaryField()[patchi];
|
phase.thermo().T().boundaryField()[patchi];
|
||||||
|
|
||||||
sumAlphaKappaEff += alphaKappaEff;
|
|
||||||
sumNotThisAlphaKappaEff += alphaKappaEff;
|
sumNotThisAlphaKappaEff += alphaKappaEff;
|
||||||
sumNotThisAlphaKappaEffT += alphaKappaEff*T.patchInternalField();
|
sumNotThisAlphaKappaEffT += alphaKappaEff*T.patchInternalField();
|
||||||
|
sumNotThisAlphaKappaEffTw += alphaKappaEff*T;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,34 +124,34 @@ void Foam::uniformFixedMultiphaseHeatFluxFvPatchScalarField::updateCoeffs()
|
|||||||
const scalarField& alpha = thisPhase.boundaryField()[patchi];
|
const scalarField& alpha = thisPhase.boundaryField()[patchi];
|
||||||
const scalarField kappaEff(thisPhase.kappaEff(patchi));
|
const scalarField kappaEff(thisPhase.kappaEff(patchi));
|
||||||
const scalarField alphaKappaEff(alpha*kappaEff);
|
const scalarField alphaKappaEff(alpha*kappaEff);
|
||||||
const fvPatchScalarField& T =
|
const fvPatchScalarField& T = *this;
|
||||||
thisPhase.thermo().T().boundaryField()[patchi];
|
|
||||||
|
|
||||||
sumAlphaKappaEff += alphaKappaEff;
|
// Calculate the phase average wall temperature
|
||||||
sumNotThisAlphaKappaEff =
|
const scalarField Tw =
|
||||||
max
|
(sumNotThisAlphaKappaEffTw + alphaKappaEff*T)
|
||||||
(
|
/(sumNotThisAlphaKappaEff + alphaKappaEff);
|
||||||
sumNotThisAlphaKappaEff,
|
|
||||||
rootSmall*kappaEff
|
valueFraction() =
|
||||||
);
|
sumNotThisAlphaKappaEff/(sumNotThisAlphaKappaEff + alphaKappaEff);
|
||||||
|
|
||||||
|
// Stabilisation for refValue
|
||||||
|
sumNotThisAlphaKappaEff = max(sumNotThisAlphaKappaEff, rootSmall*kappaEff);
|
||||||
sumNotThisAlphaKappaEffT =
|
sumNotThisAlphaKappaEffT =
|
||||||
max
|
max
|
||||||
(
|
(
|
||||||
sumNotThisAlphaKappaEffT,
|
sumNotThisAlphaKappaEffT,
|
||||||
rootSmall*kappaEff*T.patchInternalField()
|
rootSmall*kappaEff*T.patchInternalField()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Mixed parameters
|
|
||||||
valueFraction() = sumNotThisAlphaKappaEff/sumAlphaKappaEff;
|
|
||||||
refValue() = sumNotThisAlphaKappaEffT/sumNotThisAlphaKappaEff;
|
refValue() = sumNotThisAlphaKappaEffT/sumNotThisAlphaKappaEff;
|
||||||
refGrad() = q/max(alpha, rootSmall)/kappaEff;
|
|
||||||
|
refGrad() = q/(max(alpha, rootSmall)*kappaEff);
|
||||||
|
|
||||||
// Modify mixed parameters for under-relaxation
|
// Modify mixed parameters for under-relaxation
|
||||||
if (relax_ != 1)
|
if (relax_ != 1)
|
||||||
{
|
{
|
||||||
const scalarField f(valueFraction());
|
const scalarField f(valueFraction());
|
||||||
valueFraction() = 1 - relax_*(1 - f);
|
valueFraction() = 1 - relax_*(1 - f);
|
||||||
refValue() = (f*relax_*refValue() + (1 - relax_)*T)/valueFraction();
|
refValue() = (f*relax_*refValue() + (1 - relax_)*Tw)/valueFraction();
|
||||||
//refGrad() = refGrad(); // No change
|
//refGrad() = refGrad(); // No change
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -138,6 +138,15 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Allow manipulation of the boundary values
|
||||||
|
virtual bool fixesValue() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
|
|||||||
Reference in New Issue
Block a user