35 namespace regionModels
37 namespace surfaceFilmModels
49 surfaceFilmRegionModel& film,
50 const dictionary& dict
53 transferModel(
type(), film, dict),
56 coeffDict_.lookupOrDefault<scalar>(
"deltaFactorToVoF", 1.0)
60 coeffDict_.lookupOrDefault<scalar>(
"deltaFactorToFilm", 0.5)
64 coeffDict_.lookupOrDefault<scalar>(
"alphaToVoF", 0.5)
68 coeffDict_.lookupOrDefault<scalar>(
"alphaToFilm", 0.1)
72 coeffDict_.lookupOrDefault<scalar>(
"transferRateCoeff", 0.1)
75 const polyBoundaryMesh& pbm = film.regionMesh().boundaryMesh();
78 pbm.size() - film.regionMesh().globalData().processorPatches().size()
81 if (coeffDict_.found(
"patches"))
86 Info<<
" applying to patches:" <<
nl;
91 const label patchi = iter.key();
92 patchIDs_[pidi++] =
patchi;
95 patchIDs_.setSize(pidi);
96 patchTransferredMasses_.setSize(pidi, 0);
100 Info<<
" applying to all patches" <<
endl;
107 patchTransferredMasses_.setSize(patchIDs_.size(), 0);
110 if (!patchIDs_.size())
113 <<
"No patches selected" 121 VoFPatchTransfer::~VoFPatchTransfer()
147 if (!patchIDs_.size())
return;
149 const thermoSingleLayer& film = filmType<thermoSingleLayer>();
155 const polyBoundaryMesh& pbm = film.regionMesh().boundaryMesh();
158 const compressibleTwoPhaseMixture&
thermo 160 film.primaryMesh().lookupObject<compressibleTwoPhaseMixture>
179 const label patchi = patchIDs_[pidi];
180 label primaryPatchi = -1;
182 forAll(film.intCoupledPatchIDs(), i)
184 const label filmPatchi = film.intCoupledPatchIDs()[i];
186 if (filmPatchi == patchi)
188 primaryPatchi = film.primaryPatchIDs()[i];
192 if (primaryPatchi != -1)
196 film.primaryMesh().boundary()[primaryPatchi].deltaCoeffs()
198 film.toRegion(patchi, deltaCoeffs);
200 scalarField alphap(alphaVoF.boundaryField()[primaryPatchi]);
201 film.toRegion(patchi, alphap);
203 scalarField rhop(rhoVoF.boundaryField()[primaryPatchi]);
204 film.toRegion(patchi, rhop);
206 vectorField Up(UVoF.boundaryField()[primaryPatchi]);
207 film.toRegion(patchi, Up);
209 scalarField hp(heVoF.boundaryField()[primaryPatchi]);
210 film.toRegion(patchi, hp);
212 scalarField Tp(TVoF.boundaryField()[primaryPatchi]);
213 film.toRegion(patchi, Tp);
215 scalarField Cpp(CpVoF.boundaryField()[primaryPatchi]);
216 film.toRegion(patchi, Cpp);
220 film.primaryMesh().boundary()[primaryPatchi]
221 .patchInternalField(film.primaryMesh().V())
223 film.toRegion(patchi, Vp);
225 const polyPatch& pp = pbm[
patchi];
226 const labelList& faceCells = pp.faceCells();
232 scalar dMassPatch = 0;
236 const label celli = faceCells[facei];
242 delta[celli] > 2*deltaFactorToVoF_/deltaCoeffs[facei]
243 || alphap[facei] > alphaToVoF_
247 transferRateCoeff_*delta[celli]*rho[celli]*magSf[celli];
249 massToTransfer[celli] += dMass;
250 momentumToTransfer[celli] += dMass*U[celli];
251 energyToTransfer[celli] += dMass*he[celli];
257 && delta[celli] < 2*deltaFactorToFilm_/deltaCoeffs[facei]
258 && alphap[facei] < alphaToFilm_
262 -transferRateCoeff_*alphap[facei]*rhop[facei]*Vp[facei];
264 massToTransfer[celli] += dMass;
265 momentumToTransfer[celli] += dMass*Up[facei];
266 energyToTransfer[celli] += dMass*hp[facei];
269 availableMass[celli] -= dMass;
273 patchTransferredMasses_[pidi] += dMassPatch;
274 addToTransferredMass(dMassPatch);
284 getModelProperty<scalarField>
286 "patchTransferredMasses",
291 scalarField patchTransferredMassTotals(patchTransferredMasses_);
294 patchTransferredMassTotals,
297 patchTransferredMasses0 += patchTransferredMassTotals;
299 setModelProperty<scalarField>
301 "patchTransferredMasses",
302 patchTransferredMasses0
305 patchTransferredMasses_ = 0;
310 void VoFPatchTransfer::patchTransferredMassTotals
316 if (!patchIDs_.size())
return;
320 getModelProperty<scalarField>
322 "patchTransferredMasses",
327 scalarField patchTransferredMassTotals(patchTransferredMasses_);
332 const label patchi = patchIDs_[pidi];
334 patchTransferredMasses[pidi] + patchTransferredMassTotals[pidi];
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fluidReactionThermo & thermo
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-10/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< vector, fvPatchField, volMesh > volVectorField
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
VoFPatchTransfer(surfaceFilmRegionModel &film, const dictionary &dict)
Construct from surface film model.
Macros for easy insertion into run-time selection tables.
addToRunTimeSelectionTable(ejectionModel, BrunDrippingEjection, dictionary)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
wordList patchNames(nPatches)
List< label > labelList
A List of labels.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
defineTypeNameAndDebug(kinematicSingleLayer, 0)