turbulentMixingLengthFrequencyInletFvPatchScalarField.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "turbulentMixingLengthFrequencyInletFvPatchScalarField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "surfaceFields.H"
00031 #include "volFields.H"
00032 #include "RASModel.H"
00033
00034
00035
00036 namespace Foam
00037 {
00038 namespace incompressible
00039 {
00040
00041
00042
00043 turbulentMixingLengthFrequencyInletFvPatchScalarField::
00044 turbulentMixingLengthFrequencyInletFvPatchScalarField
00045 (
00046 const fvPatch& p,
00047 const DimensionedField<scalar, volMesh>& iF
00048 )
00049 :
00050 fixedValueFvPatchField<scalar>(p, iF),
00051 mixingLength_(0.0),
00052 kName_("undefined-k")
00053 {}
00054
00055 turbulentMixingLengthFrequencyInletFvPatchScalarField::
00056 turbulentMixingLengthFrequencyInletFvPatchScalarField
00057 (
00058 const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf,
00059 const fvPatch& p,
00060 const DimensionedField<scalar, volMesh>& iF,
00061 const fvPatchFieldMapper& mapper
00062 )
00063 :
00064 fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
00065 mixingLength_(ptf.mixingLength_),
00066 kName_(ptf.kName_)
00067 {}
00068
00069 turbulentMixingLengthFrequencyInletFvPatchScalarField::
00070 turbulentMixingLengthFrequencyInletFvPatchScalarField
00071 (
00072 const fvPatch& p,
00073 const DimensionedField<scalar, volMesh>& iF,
00074 const dictionary& dict
00075 )
00076 :
00077 fixedValueFvPatchField<scalar>(p, iF, dict),
00078 mixingLength_(readScalar(dict.lookup("mixingLength"))),
00079 kName_(dict.lookupOrDefault<word>("k", "k"))
00080 {}
00081
00082 turbulentMixingLengthFrequencyInletFvPatchScalarField::
00083 turbulentMixingLengthFrequencyInletFvPatchScalarField
00084 (
00085 const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf
00086 )
00087 :
00088 fixedValueFvPatchField<scalar>(ptf),
00089 mixingLength_(ptf.mixingLength_),
00090 kName_(ptf.kName_)
00091 {}
00092
00093 turbulentMixingLengthFrequencyInletFvPatchScalarField::
00094 turbulentMixingLengthFrequencyInletFvPatchScalarField
00095 (
00096 const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf,
00097 const DimensionedField<scalar, volMesh>& iF
00098 )
00099 :
00100 fixedValueFvPatchField<scalar>(ptf, iF),
00101 mixingLength_(ptf.mixingLength_),
00102 kName_(ptf.kName_)
00103 {}
00104
00105
00106
00107
00108 void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
00109 {
00110 if (updated())
00111 {
00112 return;
00113 }
00114
00115
00116 const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
00117
00118 const scalar Cmu =
00119 rasModel.coeffDict().lookupOrDefault<scalar>("Cmu", 0.09);
00120
00121 const scalar Cmu25 = pow(Cmu, 0.25);
00122
00123 const fvPatchField<scalar>& kp =
00124 patch().lookupPatchField<volScalarField, scalar>(kName_);
00125
00126 operator==(sqrt(kp)/(Cmu25*mixingLength_));
00127
00128 fixedValueFvPatchField<scalar>::updateCoeffs();
00129 }
00130
00131
00132 void turbulentMixingLengthFrequencyInletFvPatchScalarField::write
00133 (
00134 Ostream& os
00135 ) const
00136 {
00137 fvPatchField<scalar>::write(os);
00138 os.writeKeyword("mixingLength")
00139 << mixingLength_ << token::END_STATEMENT << nl;
00140 os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl;
00141 writeEntry("value", os);
00142 }
00143
00144
00145
00146
00147 makePatchTypeField
00148 (
00149 fvPatchScalarField,
00150 turbulentMixingLengthFrequencyInletFvPatchScalarField
00151 );
00152
00153
00154
00155
00156 }
00157 }
00158
00159
Copyright © 2000-2009 OpenCFD Ltd