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