fixedPressureCompressibleDensityFvPatchScalarField.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 "fixedPressureCompressibleDensityFvPatchScalarField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "fvPatchFieldMapper.H"
00030 #include "surfaceFields.H"
00031 #include "volFields.H"
00032
00033
00034
00035 namespace Foam
00036 {
00037
00038
00039
00040 fixedPressureCompressibleDensityFvPatchScalarField::
00041 fixedPressureCompressibleDensityFvPatchScalarField
00042 (
00043 const fvPatch& p,
00044 const DimensionedField<scalar, volMesh>& iF
00045 )
00046 :
00047 fixedValueFvPatchField<scalar>(p, iF),
00048 pName_("pNameIsUndefined")
00049 {}
00050
00051
00052 fixedPressureCompressibleDensityFvPatchScalarField::
00053 fixedPressureCompressibleDensityFvPatchScalarField
00054 (
00055 const fixedPressureCompressibleDensityFvPatchScalarField& ptf,
00056 const fvPatch& p,
00057 const DimensionedField<scalar, volMesh>& iF,
00058 const fvPatchFieldMapper& mapper
00059 )
00060 :
00061 fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
00062 pName_(ptf.pName_)
00063 {}
00064
00065
00066 fixedPressureCompressibleDensityFvPatchScalarField::
00067 fixedPressureCompressibleDensityFvPatchScalarField
00068 (
00069 const fvPatch& p,
00070 const DimensionedField<scalar, volMesh>& iF,
00071 const dictionary& dict
00072 )
00073 :
00074 fixedValueFvPatchField<scalar>(p, iF, dict),
00075 pName_(dict.lookup("p"))
00076 {}
00077
00078
00079 fixedPressureCompressibleDensityFvPatchScalarField::
00080 fixedPressureCompressibleDensityFvPatchScalarField
00081 (
00082 const fixedPressureCompressibleDensityFvPatchScalarField& ptf
00083 )
00084 :
00085 fixedValueFvPatchField<scalar>(ptf),
00086 pName_(ptf.pName_)
00087 {}
00088
00089
00090 fixedPressureCompressibleDensityFvPatchScalarField::
00091 fixedPressureCompressibleDensityFvPatchScalarField
00092 (
00093 const fixedPressureCompressibleDensityFvPatchScalarField& ptf,
00094 const DimensionedField<scalar, volMesh>& iF
00095 )
00096 :
00097 fixedValueFvPatchField<scalar>(ptf, iF),
00098 pName_(ptf.pName_)
00099 {}
00100
00101
00102
00103
00104 void fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs()
00105 {
00106 if (updated())
00107 {
00108 return;
00109 }
00110
00111 const fvPatchField<scalar>& pp =
00112 patch().lookupPatchField<volScalarField, scalar>(pName_);
00113
00114 const dictionary& thermoProps =
00115 db().lookupObject<IOdictionary>("thermodynamicProperties");
00116
00117 const scalar rholSat =
00118 dimensionedScalar(thermoProps.lookup("rholSat")).value();
00119
00120 const scalar pSat =
00121 dimensionedScalar(thermoProps.lookup("pSat")).value();
00122
00123 const scalar psil = dimensionedScalar(thermoProps.lookup("psil")).value();
00124
00125 operator==(rholSat + psil*(pp - pSat));
00126
00127 fixedValueFvPatchField<scalar>::updateCoeffs();
00128 }
00129
00130
00131 void fixedPressureCompressibleDensityFvPatchScalarField::write
00132 (
00133 Ostream& os
00134 ) const
00135 {
00136 fvPatchField<scalar>::write(os);
00137 os.writeKeyword("p") << pName_ << token::END_STATEMENT << nl;
00138 writeEntry("value", os);
00139 }
00140
00141
00142
00143
00144 makePatchTypeField
00145 (
00146 fvPatchScalarField,
00147 fixedPressureCompressibleDensityFvPatchScalarField
00148 );
00149
00150
00151
00152
00153 }
00154
00155
Copyright © 2000-2009 OpenCFD Ltd