phaseModel.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 "phaseModel.H"
00028 #include "fixedValueFvPatchFields.H"
00029 #include "surfaceInterpolate.H"
00030
00031
00032
00033 Foam::phaseModel::phaseModel
00034 (
00035 const fvMesh& mesh,
00036 const dictionary& transportProperties,
00037 const word& phaseName
00038 )
00039 :
00040 dict_
00041 (
00042 transportProperties.subDict("phase" + phaseName)
00043 ),
00044 name_(phaseName),
00045 d_
00046 (
00047 dict_.lookup("d")
00048 ),
00049 nu_
00050 (
00051 dict_.lookup("nu")
00052 ),
00053 rho_
00054 (
00055 dict_.lookup("rho")
00056 ),
00057 U_
00058 (
00059 IOobject
00060 (
00061 "U" + phaseName,
00062 mesh.time().timeName(),
00063 mesh,
00064 IOobject::MUST_READ,
00065 IOobject::AUTO_WRITE
00066 ),
00067 mesh
00068 )
00069 {
00070 const word phiName = "phi" + phaseName;
00071
00072 IOobject phiHeader
00073 (
00074 phiName,
00075 mesh.time().timeName(),
00076 mesh,
00077 IOobject::NO_READ
00078 );
00079
00080 if (phiHeader.headerOk())
00081 {
00082 Info<< "Reading face flux field " << phiName << endl;
00083
00084 phiPtr_.reset
00085 (
00086 new surfaceScalarField
00087 (
00088 IOobject
00089 (
00090 phiName,
00091 mesh.time().timeName(),
00092 mesh,
00093 IOobject::MUST_READ,
00094 IOobject::AUTO_WRITE
00095 ),
00096 mesh
00097 )
00098 );
00099 }
00100 else
00101 {
00102 Info<< "Calculating face flux field " << phiName << endl;
00103
00104 wordList phiTypes
00105 (
00106 U_.boundaryField().size(),
00107 calculatedFvPatchScalarField::typeName
00108 );
00109
00110 for (label i=0; i<U_.boundaryField().size(); i++)
00111 {
00112 if (isType<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
00113 {
00114 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
00115 }
00116 }
00117
00118 phiPtr_.reset
00119 (
00120 new surfaceScalarField
00121 (
00122 IOobject
00123 (
00124 phiName,
00125 mesh.time().timeName(),
00126 mesh,
00127 IOobject::NO_READ,
00128 IOobject::AUTO_WRITE
00129 ),
00130 fvc::interpolate(U_) & mesh.Sf(),
00131 phiTypes
00132 )
00133 );
00134 }
00135 }
00136
00137
00138 Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
00139 (
00140 const fvMesh& mesh,
00141 const dictionary& transportProperties,
00142 const word& phaseName
00143 )
00144 {
00145 return autoPtr<phaseModel>
00146 (
00147 new phaseModel(mesh, transportProperties, phaseName)
00148 );
00149 }
00150
00151
00152
00153
00154 Foam::phaseModel::~phaseModel()
00155 {}
00156
00157
00158
Copyright © 2000-2009 OpenCFD Ltd