turbulentIntensityKineticEnergyInletFvPatchScalarField.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 "turbulentIntensityKineticEnergyInletFvPatchScalarField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "surfaceFields.H"
00031 #include "volFields.H"
00032
00033
00034
00035 Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
00036 turbulentIntensityKineticEnergyInletFvPatchScalarField
00037 (
00038 const fvPatch& p,
00039 const DimensionedField<scalar, volMesh>& iF
00040 )
00041 :
00042 fixedValueFvPatchField<scalar>(p, iF),
00043 intensity_(0.05)
00044 {}
00045
00046 Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
00047 turbulentIntensityKineticEnergyInletFvPatchScalarField
00048 (
00049 const turbulentIntensityKineticEnergyInletFvPatchScalarField& ptf,
00050 const fvPatch& p,
00051 const DimensionedField<scalar, volMesh>& iF,
00052 const fvPatchFieldMapper& mapper
00053 )
00054 :
00055 fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
00056 intensity_(ptf.intensity_)
00057 {}
00058
00059 Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
00060 turbulentIntensityKineticEnergyInletFvPatchScalarField
00061 (
00062 const fvPatch& p,
00063 const DimensionedField<scalar, volMesh>& iF,
00064 const dictionary& dict
00065 )
00066 :
00067 fixedValueFvPatchField<scalar>(p, iF, dict),
00068 intensity_(readScalar(dict.lookup("intensity")))
00069 {
00070 if (intensity_ < 0 || intensity_ > 1)
00071 {
00072 FatalErrorIn
00073 (
00074 "turbulentIntensityKineticEnergyInletFvPatchScalarField::"
00075 "turbulentIntensityKineticEnergyInletFvPatchScalarField"
00076 "(const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, "
00077 "const dictionary& dict)"
00078 ) << "Turbulence intensity should be specified as a fraction 0-1 "
00079 "of the mean velocity\n"
00080 " value given is " << intensity_
00081 << "\n on patch " << this->patch().name()
00082 << " of field " << this->dimensionedInternalField().name()
00083 << " in file " << this->dimensionedInternalField().objectPath()
00084 << exit(FatalError);
00085 }
00086 }
00087
00088 Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
00089 turbulentIntensityKineticEnergyInletFvPatchScalarField
00090 (
00091 const turbulentIntensityKineticEnergyInletFvPatchScalarField& ptf
00092 )
00093 :
00094 fixedValueFvPatchField<scalar>(ptf),
00095 intensity_(ptf.intensity_)
00096 {}
00097
00098
00099 Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
00100 turbulentIntensityKineticEnergyInletFvPatchScalarField
00101 (
00102 const turbulentIntensityKineticEnergyInletFvPatchScalarField& ptf,
00103 const DimensionedField<scalar, volMesh>& iF
00104 )
00105 :
00106 fixedValueFvPatchField<scalar>(ptf, iF),
00107 intensity_(ptf.intensity_)
00108 {}
00109
00110
00111
00112
00113 void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::
00114 updateCoeffs()
00115 {
00116 if (updated())
00117 {
00118 return;
00119 }
00120
00121 const fvPatchField<vector>& Up =
00122 patch().lookupPatchField<volVectorField, vector>("U");
00123
00124 operator==(1.5*sqr(intensity_)*magSqr(Up));
00125
00126 fixedValueFvPatchField<scalar>::updateCoeffs();
00127 }
00128
00129
00130 void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write
00131 (
00132 Ostream& os
00133 ) const
00134 {
00135 fvPatchField<scalar>::write(os);
00136 os.writeKeyword("intensity") << intensity_ << token::END_STATEMENT << nl;
00137 writeEntry("value", os);
00138 }
00139
00140
00141
00142
00143 namespace Foam
00144 {
00145 makePatchTypeField
00146 (
00147 fvPatchScalarField,
00148 turbulentIntensityKineticEnergyInletFvPatchScalarField
00149 );
00150 }
00151
00152
Copyright © 2000-2009 OpenCFD Ltd