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()
145 if (!patchIDs_.size())
return;
147 const thermoSingleLayer& film = filmType<thermoSingleLayer>();
153 const polyBoundaryMesh& pbm = film.regionMesh().boundaryMesh();
156 const twoPhaseMixtureThermo&
thermo 158 film.primaryMesh().lookupObject<twoPhaseMixtureThermo>
172 const label patchi = patchIDs_[pidi];
173 label primaryPatchi = -1;
175 forAll(film.intCoupledPatchIDs(), i)
177 const label filmPatchi = film.intCoupledPatchIDs()[i];
179 if (filmPatchi == patchi)
181 primaryPatchi = film.primaryPatchIDs()[i];
185 if (primaryPatchi != -1)
189 film.primaryMesh().boundary()[primaryPatchi].deltaCoeffs()
191 film.toRegion(patchi, deltaCoeffs);
193 scalarField hp(heVoF.boundaryField()[primaryPatchi]);
194 film.toRegion(patchi, hp);
196 scalarField Tp(TVoF.boundaryField()[primaryPatchi]);
197 film.toRegion(patchi, Tp);
199 scalarField Cpp(CpVoF.boundaryField()[primaryPatchi]);
200 film.toRegion(patchi, Cpp);
202 scalarField rhop(rhoVoF.boundaryField()[primaryPatchi]);
203 film.toRegion(patchi, rhop);
205 scalarField alphap(alphaVoF.boundaryField()[primaryPatchi]);
206 film.toRegion(patchi, alphap);
210 film.primaryMesh().boundary()[primaryPatchi]
211 .patchInternalField(film.primaryMesh().V())
213 film.toRegion(patchi, Vp);
215 const polyPatch& pp = pbm[
patchi];
216 const labelList& faceCells = pp.faceCells();
219 scalar dMassPatch = 0;
223 const label celli = faceCells[facei];
229 delta[celli] > 2*deltaFactorToVoF_/deltaCoeffs[facei]
230 || alphap[facei] > alphaToVoF_
234 transferRateCoeff_*delta[celli]*rho[celli]*magSf[celli];
236 massToTransfer[celli] += dMass;
237 energyToTransfer[celli] += dMass*film.h()[celli];
243 && delta[celli] < 2*deltaFactorToFilm_/deltaCoeffs[facei]
244 && alphap[facei] < alphaToFilm_
248 -transferRateCoeff_*alphap[facei]*rhop[facei]*Vp[facei];
250 massToTransfer[celli] += dMass;
251 energyToTransfer[celli] += dMass*hp[facei];
254 availableMass[celli] -= dMass;
258 patchTransferredMasses_[pidi] += dMassPatch;
259 addToTransferredMass(dMassPatch);
269 getModelProperty<scalarField>
271 "patchTransferredMasses",
276 scalarField patchTransferredMassTotals(patchTransferredMasses_);
277 Pstream::listCombineGather
279 patchTransferredMassTotals,
282 patchTransferredMasses0 += patchTransferredMassTotals;
284 setModelProperty<scalarField>
286 "patchTransferredMasses",
287 patchTransferredMasses0
290 patchTransferredMasses_ = 0;
295 void VoFPatchTransfer::patchTransferredMassTotals
301 if (!patchIDs_.size())
return;
305 getModelProperty<scalarField>
307 "patchTransferredMasses",
312 scalarField patchTransferredMassTotals(patchTransferredMasses_);
313 Pstream::listCombineGather(patchTransferredMassTotals, plusEqOp<scalar>());
317 const label patchi = patchIDs_[pidi];
319 patchTransferredMasses[pidi] + patchTransferredMassTotals[pidi];
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
rhoReactionThermo & thermo
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
VoFPatchTransfer(surfaceFilmRegionModel &film, const dictionary &dict)
Construct from surface film model.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
wordList patchNames(nPatches)
List< label > labelList
A List of labels.
const word dictName("particleTrackDict")
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
volScalarField scalarField(fieldObject, mesh)
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(rho0+psi *p, rhoMin);# 1 "/home/ubuntu/OpenFOAM-8/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()
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
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)