SRFVelocityFvPatchVectorField.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 "SRFVelocityFvPatchVectorField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "volFields.H"
00030
00031 #include "SRFModel.H"
00032
00033
00034
00035 namespace Foam
00036 {
00037
00038
00039
00040 SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
00041 (
00042 const fvPatch& p,
00043 const DimensionedField<vector, volMesh>& iF
00044 )
00045 :
00046 fixedValueFvPatchVectorField(p, iF),
00047 relative_(0),
00048 inletValue_(p.size(), vector::zero)
00049 {}
00050
00051
00052 SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
00053 (
00054 const SRFVelocityFvPatchVectorField& ptf,
00055 const fvPatch& p,
00056 const DimensionedField<vector, volMesh>& iF,
00057 const fvPatchFieldMapper& mapper
00058 )
00059 :
00060 fixedValueFvPatchVectorField(ptf, p, iF, mapper),
00061 relative_(ptf.relative_),
00062 inletValue_(ptf.inletValue_, mapper)
00063 {}
00064
00065
00066 SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
00067 (
00068 const fvPatch& p,
00069 const DimensionedField<vector, volMesh>& iF,
00070 const dictionary& dict
00071 )
00072 :
00073 fixedValueFvPatchVectorField(p, iF),
00074 relative_(dict.lookup("relative")),
00075 inletValue_("inletValue", dict, p.size())
00076 {
00077 fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
00078 }
00079
00080
00081 SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
00082 (
00083 const SRFVelocityFvPatchVectorField& srfvpvf
00084 )
00085 :
00086 fixedValueFvPatchVectorField(srfvpvf),
00087 relative_(srfvpvf.relative_),
00088 inletValue_(srfvpvf.inletValue_)
00089 {}
00090
00091
00092 SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
00093 (
00094 const SRFVelocityFvPatchVectorField& srfvpvf,
00095 const DimensionedField<vector, volMesh>& iF
00096 )
00097 :
00098 fixedValueFvPatchVectorField(srfvpvf, iF),
00099 relative_(srfvpvf.relative_),
00100 inletValue_(srfvpvf.inletValue_)
00101 {}
00102
00103
00104
00105
00106 void SRFVelocityFvPatchVectorField::autoMap
00107 (
00108 const fvPatchFieldMapper& m
00109 )
00110 {
00111 vectorField::autoMap(m);
00112 inletValue_.autoMap(m);
00113 }
00114
00115
00116 void SRFVelocityFvPatchVectorField::rmap
00117 (
00118 const fvPatchVectorField& ptf,
00119 const labelList& addr
00120 )
00121 {
00122 fixedValueFvPatchVectorField::rmap(ptf, addr);
00123
00124 const SRFVelocityFvPatchVectorField& tiptf =
00125 refCast<const SRFVelocityFvPatchVectorField>(ptf);
00126
00127 inletValue_.rmap(tiptf.inletValue_, addr);
00128 }
00129
00130
00131 void SRFVelocityFvPatchVectorField::updateCoeffs()
00132 {
00133 if (updated())
00134 {
00135 return;
00136 }
00137
00138
00139 if (relative_)
00140 {
00141
00142 const SRF::SRFModel& srf =
00143 db().lookupObject<SRF::SRFModel>("SRFProperties");
00144
00145
00146 const vectorField SRFVelocity = srf.velocity(patch().Cf());
00147
00148 operator==(-SRFVelocity + inletValue_);
00149 }
00150
00151 else
00152 {
00153 operator==(inletValue_);
00154 }
00155
00156 fixedValueFvPatchVectorField::updateCoeffs();
00157 }
00158
00159
00160 void SRFVelocityFvPatchVectorField::write(Ostream& os) const
00161 {
00162 fvPatchVectorField::write(os);
00163 os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl;
00164 inletValue_.writeEntry("inletValue", os);
00165 writeEntry("value", os);
00166 }
00167
00168
00169
00170
00171 makePatchTypeField
00172 (
00173 fvPatchVectorField,
00174 SRFVelocityFvPatchVectorField
00175 );
00176
00177
00178
00179 }
00180
00181
Copyright © 2000-2009 OpenCFD Ltd