mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added Yi Wang's RMS correction factor and parameter alpha.
This commit is contained in:
@ -44,6 +44,7 @@ turbulentInletFvPatchField<Type>::turbulentInletFvPatchField
|
|||||||
ranGen_(label(0)),
|
ranGen_(label(0)),
|
||||||
fluctuationScale_(pTraits<Type>::zero),
|
fluctuationScale_(pTraits<Type>::zero),
|
||||||
referenceField_(p.size()),
|
referenceField_(p.size()),
|
||||||
|
alpha_(0.1),
|
||||||
curTimeIndex_(-1)
|
curTimeIndex_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -61,6 +62,7 @@ turbulentInletFvPatchField<Type>::turbulentInletFvPatchField
|
|||||||
ranGen_(label(0)),
|
ranGen_(label(0)),
|
||||||
fluctuationScale_(ptf.fluctuationScale_),
|
fluctuationScale_(ptf.fluctuationScale_),
|
||||||
referenceField_(ptf.referenceField_, mapper),
|
referenceField_(ptf.referenceField_, mapper),
|
||||||
|
alpha_(ptf.alpha_),
|
||||||
curTimeIndex_(-1)
|
curTimeIndex_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -77,6 +79,7 @@ turbulentInletFvPatchField<Type>::turbulentInletFvPatchField
|
|||||||
ranGen_(label(0)),
|
ranGen_(label(0)),
|
||||||
fluctuationScale_(pTraits<Type>(dict.lookup("fluctuationScale"))),
|
fluctuationScale_(pTraits<Type>(dict.lookup("fluctuationScale"))),
|
||||||
referenceField_("referenceField", dict, p.size()),
|
referenceField_("referenceField", dict, p.size()),
|
||||||
|
alpha_(dict.lookupOrDefault<scalar>("alpha", 0.1)),
|
||||||
curTimeIndex_(-1)
|
curTimeIndex_(-1)
|
||||||
{
|
{
|
||||||
if (dict.found("value"))
|
if (dict.found("value"))
|
||||||
@ -103,6 +106,7 @@ turbulentInletFvPatchField<Type>::turbulentInletFvPatchField
|
|||||||
ranGen_(ptf.ranGen_),
|
ranGen_(ptf.ranGen_),
|
||||||
fluctuationScale_(ptf.fluctuationScale_),
|
fluctuationScale_(ptf.fluctuationScale_),
|
||||||
referenceField_(ptf.referenceField_),
|
referenceField_(ptf.referenceField_),
|
||||||
|
alpha_(ptf.alpha_),
|
||||||
curTimeIndex_(-1)
|
curTimeIndex_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -118,6 +122,7 @@ turbulentInletFvPatchField<Type>::turbulentInletFvPatchField
|
|||||||
ranGen_(ptf.ranGen_),
|
ranGen_(ptf.ranGen_),
|
||||||
fluctuationScale_(ptf.fluctuationScale_),
|
fluctuationScale_(ptf.fluctuationScale_),
|
||||||
referenceField_(ptf.referenceField_),
|
referenceField_(ptf.referenceField_),
|
||||||
|
alpha_(ptf.alpha_),
|
||||||
curTimeIndex_(-1)
|
curTimeIndex_(-1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -170,9 +175,14 @@ void turbulentInletFvPatchField<Type>::updateCoeffs()
|
|||||||
ranGen_.randomise(randomField[facei]);
|
ranGen_.randomise(randomField[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
patchField =
|
// Correction-factor proposed by Yi Wang to compensate for the loss
|
||||||
0.9*patchField
|
// of RMS fluctuation due to the temporal correlation introduced by
|
||||||
+ 0.1*
|
// the alpha parameter.
|
||||||
|
scalar rmsCorr = sqrt(12*(2*alpha_ - sqr(alpha_)))/alpha_;
|
||||||
|
|
||||||
|
patchField =
|
||||||
|
(rmsCorr*(1 - alpha_))*patchField
|
||||||
|
+ (rmsCorr*alpha_)*
|
||||||
(
|
(
|
||||||
referenceField_
|
referenceField_
|
||||||
+ cmptMultiply
|
+ cmptMultiply
|
||||||
|
|||||||
@ -26,7 +26,17 @@ Class
|
|||||||
Foam::turbulentInletFvPatchField
|
Foam::turbulentInletFvPatchField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::turbulentInletFvPatchField
|
Generate a fluctuating inlet condition by adding a random component
|
||||||
|
to a reference (mean) field.
|
||||||
|
Input:
|
||||||
|
referenceField
|
||||||
|
Mean field.
|
||||||
|
fluctuationScale
|
||||||
|
RMS fluctuation, provided as the fraction of the mean field.
|
||||||
|
alpha
|
||||||
|
temporal correlation factor;
|
||||||
|
the fraction of the new random component added to the previous
|
||||||
|
time-step (defaults to 0.1).
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
turbulentInletFvPatchField.C
|
turbulentInletFvPatchField.C
|
||||||
@ -59,6 +69,7 @@ class turbulentInletFvPatchField
|
|||||||
Random ranGen_;
|
Random ranGen_;
|
||||||
Type fluctuationScale_;
|
Type fluctuationScale_;
|
||||||
Field<Type> referenceField_;
|
Field<Type> referenceField_;
|
||||||
|
scalar alpha_;
|
||||||
label curTimeIndex_;
|
label curTimeIndex_;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user