turbulentHeatFluxTemperatureFvPatchScalarField.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 "turbulentHeatFluxTemperatureFvPatchScalarField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "volFields.H"
00031
00032
00033
00034 namespace Foam
00035 {
00036 namespace incompressible
00037 {
00038
00039
00040
00041 turbulentHeatFluxTemperatureFvPatchScalarField::
00042 turbulentHeatFluxTemperatureFvPatchScalarField
00043 (
00044 const fvPatch& p,
00045 const DimensionedField<scalar, volMesh>& iF
00046 )
00047 :
00048 fixedGradientFvPatchScalarField(p, iF),
00049 q_(p.size(), 0.0),
00050 alphaEffName_("undefinedAlphaEff"),
00051 CpName_("undefinedCp")
00052 {}
00053
00054
00055 turbulentHeatFluxTemperatureFvPatchScalarField::
00056 turbulentHeatFluxTemperatureFvPatchScalarField
00057 (
00058 const turbulentHeatFluxTemperatureFvPatchScalarField& ptf,
00059 const fvPatch& p,
00060 const DimensionedField<scalar, volMesh>& iF,
00061 const fvPatchFieldMapper& mapper
00062 )
00063 :
00064 fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
00065 q_(ptf.q_, mapper),
00066 alphaEffName_(ptf.alphaEffName_),
00067 CpName_(ptf.CpName_)
00068 {}
00069
00070
00071 turbulentHeatFluxTemperatureFvPatchScalarField::
00072 turbulentHeatFluxTemperatureFvPatchScalarField
00073 (
00074 const fvPatch& p,
00075 const DimensionedField<scalar, volMesh>& iF,
00076 const dictionary& dict
00077 )
00078 :
00079 fixedGradientFvPatchScalarField(p, iF),
00080 q_("q", dict, p.size()),
00081 alphaEffName_(dict.lookup("alphaEff")),
00082 CpName_(dict.lookup("Cp"))
00083 {
00084 fvPatchField<scalar>::operator=(patchInternalField());
00085 gradient() = 0.0;
00086 }
00087
00088
00089 turbulentHeatFluxTemperatureFvPatchScalarField::
00090 turbulentHeatFluxTemperatureFvPatchScalarField
00091 (
00092 const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf
00093 )
00094 :
00095 fixedGradientFvPatchScalarField(thftpsf),
00096 q_(thftpsf.q_),
00097 alphaEffName_(thftpsf.alphaEffName_),
00098 CpName_(thftpsf.CpName_)
00099 {}
00100
00101
00102 turbulentHeatFluxTemperatureFvPatchScalarField::
00103 turbulentHeatFluxTemperatureFvPatchScalarField
00104 (
00105 const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf,
00106 const DimensionedField<scalar, volMesh>& iF
00107 )
00108 :
00109 fixedGradientFvPatchScalarField(thftpsf, iF),
00110 q_(thftpsf.q_),
00111 alphaEffName_(thftpsf.alphaEffName_),
00112 CpName_(thftpsf.CpName_)
00113 {}
00114
00115
00116
00117
00118 void turbulentHeatFluxTemperatureFvPatchScalarField::autoMap
00119 (
00120 const fvPatchFieldMapper& m
00121 )
00122 {
00123 scalarField::autoMap(m);
00124 q_.autoMap(m);
00125 }
00126
00127
00128 void turbulentHeatFluxTemperatureFvPatchScalarField::rmap
00129 (
00130 const fvPatchScalarField& ptf,
00131 const labelList& addr
00132 )
00133 {
00134 fixedGradientFvPatchScalarField::rmap(ptf, addr);
00135
00136 const turbulentHeatFluxTemperatureFvPatchScalarField& thftptf =
00137 refCast<const turbulentHeatFluxTemperatureFvPatchScalarField>
00138 (
00139 ptf
00140 );
00141
00142 q_.rmap(thftptf.q_, addr);
00143 }
00144
00145
00146 void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
00147 {
00148 if (updated())
00149 {
00150 return;
00151 }
00152
00153 const scalarField& alphaEffp =
00154 patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);
00155
00156 const scalarField& Cpp =
00157 patch().lookupPatchField<volScalarField, scalar>(CpName_);
00158
00159 gradient() = q_/(Cpp*alphaEffp);
00160
00161 fixedGradientFvPatchScalarField::updateCoeffs();
00162 }
00163
00164
00165 void turbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os) const
00166 {
00167 fixedGradientFvPatchScalarField::write(os);
00168 q_.writeEntry("q", os);
00169 os.writeKeyword("alphaEff") << alphaEffName_ << token::END_STATEMENT << nl;
00170 os.writeKeyword("Cp") << CpName_ << token::END_STATEMENT << nl;
00171 writeEntry("value", os);
00172 }
00173
00174
00175
00176
00177 makePatchTypeField
00178 (
00179 fvPatchScalarField,
00180 turbulentHeatFluxTemperatureFvPatchScalarField
00181 );
00182
00183
00184
00185
00186 }
00187 }
00188
00189
00190
00191
Copyright © 2000-2009 OpenCFD Ltd