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