rotatingTotalPressureFvPatchScalarField.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 "rotatingTotalPressureFvPatchScalarField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "volFields.H"
00031 #include "surfaceFields.H"
00032
00033
00034
00035 namespace Foam
00036 {
00037
00038
00039
00040 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
00041 (
00042 const fvPatch& p,
00043 const DimensionedField<scalar, volMesh>& iF
00044 )
00045 :
00046 totalPressureFvPatchScalarField(p, iF),
00047 omega_(vector::zero)
00048 {}
00049
00050
00051 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
00052 (
00053 const rotatingTotalPressureFvPatchScalarField& ptf,
00054 const fvPatch& p,
00055 const DimensionedField<scalar, volMesh>& iF,
00056 const fvPatchFieldMapper& mapper
00057 )
00058 :
00059 totalPressureFvPatchScalarField(ptf, p, iF, mapper),
00060 omega_(ptf.omega_)
00061 {}
00062
00063
00064 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
00065 (
00066 const fvPatch& p,
00067 const DimensionedField<scalar, volMesh>& iF,
00068 const dictionary& dict
00069 )
00070 :
00071 totalPressureFvPatchScalarField(p, iF, dict),
00072 omega_(dict.lookup("omega"))
00073 {}
00074
00075
00076 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
00077 (
00078 const rotatingTotalPressureFvPatchScalarField& tppsf
00079 )
00080 :
00081 totalPressureFvPatchScalarField(tppsf),
00082 omega_(tppsf.omega_)
00083 {}
00084
00085
00086 rotatingTotalPressureFvPatchScalarField::rotatingTotalPressureFvPatchScalarField
00087 (
00088 const rotatingTotalPressureFvPatchScalarField& tppsf,
00089 const DimensionedField<scalar, volMesh>& iF
00090 )
00091 :
00092 totalPressureFvPatchScalarField(tppsf, iF),
00093 omega_(tppsf.omega_)
00094 {}
00095
00096
00097
00098
00099 void rotatingTotalPressureFvPatchScalarField::updateCoeffs()
00100 {
00101 if (updated())
00102 {
00103 return;
00104 }
00105
00106 vector axisHat = omega_/mag(omega_);
00107 vectorField rotationVelocity =
00108 omega_ ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()));
00109
00110 vectorField Up = patch().lookupPatchField<volVectorField, vector>(UName())
00111 + rotationVelocity;
00112
00113 totalPressureFvPatchScalarField::updateCoeffs(Up);
00114 }
00115
00116
00117 void rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const
00118 {
00119 totalPressureFvPatchScalarField::write(os);
00120 os.writeKeyword("omega")<< omega_ << token::END_STATEMENT << nl;
00121 }
00122
00123
00124
00125
00126 makePatchTypeField
00127 (
00128 fvPatchScalarField,
00129 rotatingTotalPressureFvPatchScalarField
00130 );
00131
00132
00133
00134 }
00135
00136
Copyright © 2000-2009 OpenCFD Ltd