multiphaseSystem.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "multiphaseSystem.H"
27 #include "alphaContactAngleFvPatchScalarField.H"
28 
29 #include "MULES.H"
30 #include "subCycle.H"
31 #include "UniformField.H"
32 
33 #include "fvcDdt.H"
34 #include "fvcDiv.H"
35 #include "fvcSnGrad.H"
36 #include "fvcFlux.H"
37 #include "fvcMeshPhi.H"
38 #include "fvcSup.H"
39 
40 #include "fvmDdt.H"
41 #include "fvmLaplacian.H"
42 #include "fvmSup.H"
43 
44 // * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48  defineTypeNameAndDebug(multiphaseSystem, 0);
49  defineRunTimeSelectionTable(multiphaseSystem, dictionary);
50 }
51 
52 const Foam::scalar Foam::multiphaseSystem::convertToRad =
54 
55 
56 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
57 
58 void Foam::multiphaseSystem::calcAlphas()
59 {
60  scalar level = 0.0;
61  alphas_ == 0.0;
62 
63  forAll(phases(), i)
64  {
65  alphas_ += level*phases()[i];
66  level += 1.0;
67  }
68 }
69 
70 
71 void Foam::multiphaseSystem::solveAlphas()
72 {
73  forAll(phases(), phasei)
74  {
75  phases()[phasei].correctBoundaryConditions();
76  }
77 
78  // Calculate the void fraction
79  volScalarField alphaVoid
80  (
81  IOobject
82  (
83  "alphaVoid",
84  mesh_.time().timeName(),
85  mesh_
86  ),
87  mesh_,
88  dimensionedScalar("alphaVoid", dimless, 1)
89  );
90  forAll(stationaryPhases(), stationaryPhasei)
91  {
92  alphaVoid -= stationaryPhases()[stationaryPhasei];
93  }
94 
95  // Generate face-alphas
96  PtrList<surfaceScalarField> alphafs(phases().size());
97  forAll(phases(), phasei)
98  {
99  phaseModel& phase = phases()[phasei];
100  alphafs.set
101  (
102  phasei,
104  (
105  IOobject::groupName("alphaf", phase.name()),
106  upwind<scalar>(mesh_, phi_).interpolate(phase)
107  )
108  );
109  }
110 
111  // Create correction fluxes
112  PtrList<surfaceScalarField> alphaPhiCorrs(phases().size());
113  forAll(stationaryPhases(), stationaryPhasei)
114  {
115  phaseModel& phase = stationaryPhases()[stationaryPhasei];
116 
117  alphaPhiCorrs.set
118  (
119  phase.index(),
121  (
122  IOobject::groupName("alphaPhiCorr", phase.name()),
123  - upwind<scalar>(mesh_, phi_).flux(phase)
124  )
125  );
126  }
127  forAll(movingPhases(), movingPhasei)
128  {
129  phaseModel& phase = movingPhases()[movingPhasei];
130  volScalarField& alpha = phase;
131 
132  alphaPhiCorrs.set
133  (
134  phase.index(),
136  (
137  IOobject::groupName("alphaPhiCorr", phase.name()),
138  fvc::flux(phi_, phase, "div(phi," + alpha.name() + ')')
139  )
140  );
141 
142  surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phase.index()];
143 
144  forAll(phases(), phasei)
145  {
146  phaseModel& phase2 = phases()[phasei];
147  volScalarField& alpha2 = phase2;
148 
149  if (&phase2 == &phase) continue;
150 
151  surfaceScalarField phir(phase.phi() - phase2.phi());
152 
153  cAlphaTable::const_iterator cAlpha
154  (
155  cAlphas_.find(phasePairKey(phase.name(), phase2.name()))
156  );
157 
158  if (cAlpha != cAlphas_.end())
159  {
161  (
162  (mag(phi_) + mag(phir))/mesh_.magSf()
163  );
164 
165  phir += min(cAlpha()*phic, max(phic))*nHatf(phase, phase2);
166  }
167 
168  word phirScheme
169  (
170  "div(phir," + alpha2.name() + ',' + alpha.name() + ')'
171  );
172 
173  alphaPhiCorr += fvc::flux
174  (
175  -fvc::flux(-phir, phase2, phirScheme),
176  phase,
177  phirScheme
178  );
179  }
180 
181  phase.correctInflowOutflow(alphaPhiCorr);
182 
184  (
185  geometricOneField(),
186  phase,
187  phi_,
188  alphaPhiCorr,
189  zeroField(),
190  zeroField(),
191  min(alphaVoid.primitiveField(), phase.alphaMax())(),
192  zeroField(),
193  true
194  );
195  }
196 
197  // Limit the flux sums, fixing those of the stationary phases
198  labelHashSet fixedAlphaPhiCorrs;
199  forAll(stationaryPhases(), stationaryPhasei)
200  {
201  fixedAlphaPhiCorrs.insert(stationaryPhases()[stationaryPhasei].index());
202  }
203  MULES::limitSum(alphafs, alphaPhiCorrs, fixedAlphaPhiCorrs);
204 
205  // Solve for the moving phase alphas
206  forAll(movingPhases(), movingPhasei)
207  {
208  phaseModel& phase = movingPhases()[movingPhasei];
209  volScalarField& alpha = phase;
210 
211  surfaceScalarField& alphaPhi = alphaPhiCorrs[phase.index()];
212  alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase);
213  phase.correctInflowOutflow(alphaPhi);
214 
216  (
217  IOobject
218  (
219  "Sp",
220  mesh_.time().timeName(),
221  mesh_
222  ),
223  mesh_,
225  );
226 
228  (
229  "Su",
230  min(alpha, scalar(1))*fvc::div(fvc::absolute(phi_, phase.U()))
231  );
232 
233  if (phase.divU().valid())
234  {
235  const scalarField& dgdt = phase.divU()();
236 
237  forAll(dgdt, celli)
238  {
239  if (dgdt[celli] > 0.0)
240  {
241  Sp[celli] -= dgdt[celli];
242  Su[celli] += dgdt[celli];
243  }
244  else if (dgdt[celli] < 0.0)
245  {
246  Sp[celli] +=
247  dgdt[celli]
248  *(1 - alpha[celli])/max(alpha[celli], 1e-4);
249  }
250  }
251  }
252 
253  forAll(phases(), phasej)
254  {
255  const phaseModel& phase2 = phases()[phasej];
256  const volScalarField& alpha2 = phase2;
257 
258  if (&phase2 == &phase) continue;
259 
260  if (phase2.divU().valid())
261  {
262  const scalarField& dgdt2 = phase2.divU()();
263 
264  forAll(dgdt2, celli)
265  {
266  if (dgdt2[celli] < 0.0)
267  {
268  Sp[celli] +=
269  dgdt2[celli]
270  *(1 - alpha2[celli])/max(alpha2[celli], 1e-4);
271 
272  Su[celli] -=
273  dgdt2[celli]
274  *alpha[celli]/max(alpha2[celli], 1e-4);
275  }
276  else if (dgdt2[celli] > 0.0)
277  {
278  Sp[celli] -= dgdt2[celli];
279  }
280  }
281  }
282  }
283 
285  (
286  geometricOneField(),
287  alpha,
288  alphaPhi,
289  Sp,
290  Su
291  );
292 
293  phase.alphaPhiRef() = alphaPhi;
294  }
295 
296  // Report the phase fractions and the phase fraction sum
297  forAll(phases(), phasei)
298  {
299  phaseModel& phase = phases()[phasei];
300 
301  Info<< phase.name() << " fraction, min, max = "
302  << phase.weightedAverage(mesh_.V()).value()
303  << ' ' << min(phase).value()
304  << ' ' << max(phase).value()
305  << endl;
306  }
307 
308  volScalarField sumAlphaMoving
309  (
310  IOobject
311  (
312  "sumAlphaMoving",
313  mesh_.time().timeName(),
314  mesh_
315  ),
316  mesh_,
317  dimensionedScalar("sumAlphaMoving", dimless, 0)
318  );
319  forAll(movingPhases(), movingPhasei)
320  {
321  sumAlphaMoving += movingPhases()[movingPhasei];
322  }
323 
324  Info<< "Phase-sum volume fraction, min, max = "
325  << (sumAlphaMoving + 1 - alphaVoid)().weightedAverage(mesh_.V()).value()
326  << ' ' << min(sumAlphaMoving + 1 - alphaVoid).value()
327  << ' ' << max(sumAlphaMoving + 1 - alphaVoid).value()
328  << endl;
329 
330  // Correct the sum of the phase fractions to avoid drift
331  forAll(movingPhases(), movingPhasei)
332  {
333  movingPhases()[movingPhasei] *= alphaVoid/sumAlphaMoving;
334  }
335 }
336 
337 
338 Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseSystem::nHatfv
339 (
340  const volScalarField& alpha1,
341  const volScalarField& alpha2
342 ) const
343 {
344  /*
345  // Cell gradient of alpha
346  volVectorField gradAlpha =
347  alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2);
348 
349  // Interpolated face-gradient of alpha
350  surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha);
351  */
352 
353  surfaceVectorField gradAlphaf
354  (
356  - fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2))
357  );
358 
359  // Face unit interface normal
360  return gradAlphaf/(mag(gradAlphaf) + deltaN_);
361 }
362 
363 
364 Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::nHatf
365 (
366  const volScalarField& alpha1,
367  const volScalarField& alpha2
368 ) const
369 {
370  // Face unit interface normal flux
371  return nHatfv(alpha1, alpha2) & mesh_.Sf();
372 }
373 
374 
375 // Correction for the boundary condition on the unit normal nHat on
376 // walls to produce the correct contact angle.
377 
378 // The dynamic contact angle is calculated from the component of the
379 // velocity on the direction of the interface, parallel to the wall.
380 
381 void Foam::multiphaseSystem::correctContactAngle
382 (
383  const phaseModel& phase1,
384  const phaseModel& phase2,
385  surfaceVectorField::Boundary& nHatb
386 ) const
387 {
388  const volScalarField::Boundary& gbf
389  = phase1.boundaryField();
390 
391  const fvBoundaryMesh& boundary = mesh_.boundary();
392 
393  forAll(boundary, patchi)
394  {
395  if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
396  {
397  const alphaContactAngleFvPatchScalarField& acap =
398  refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
399 
400  vectorField& nHatPatch = nHatb[patchi];
401 
402  vectorField AfHatPatch
403  (
404  mesh_.Sf().boundaryField()[patchi]
405  /mesh_.magSf().boundaryField()[patchi]
406  );
407 
408  alphaContactAngleFvPatchScalarField::thetaPropsTable::
409  const_iterator tp =
410  acap.thetaProps()
411  .find(phasePairKey(phase1.name(), phase2.name()));
412 
413  if (tp == acap.thetaProps().end())
414  {
416  << "Cannot find interface "
417  << phasePairKey(phase1.name(), phase2.name())
418  << "\n in table of theta properties for patch "
419  << acap.patch().name()
420  << exit(FatalError);
421  }
422 
423  bool matched = (tp.key().first() == phase1.name());
424 
425  scalar theta0 = convertToRad*tp().theta0(matched);
426  scalarField theta(boundary[patchi].size(), theta0);
427 
428  scalar uTheta = tp().uTheta();
429 
430  // Calculate the dynamic contact angle if required
431  if (uTheta > small)
432  {
433  scalar thetaA = convertToRad*tp().thetaA(matched);
434  scalar thetaR = convertToRad*tp().thetaR(matched);
435 
436  // Calculated the component of the velocity parallel to the wall
437  vectorField Uwall
438  (
439  phase1.U()().boundaryField()[patchi].patchInternalField()
440  - phase1.U()().boundaryField()[patchi]
441  );
442  Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
443 
444  // Find the direction of the interface parallel to the wall
445  vectorField nWall
446  (
447  nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
448  );
449 
450  // Normalise nWall
451  nWall /= (mag(nWall) + small);
452 
453  // Calculate Uwall resolved normal to the interface parallel to
454  // the interface
455  scalarField uwall(nWall & Uwall);
456 
457  theta += (thetaA - thetaR)*tanh(uwall/uTheta);
458  }
459 
460 
461  // Reset nHatPatch to correspond to the contact angle
462 
463  scalarField a12(nHatPatch & AfHatPatch);
464 
465  scalarField b1(cos(theta));
466 
467  scalarField b2(nHatPatch.size());
468 
469  forAll(b2, facei)
470  {
471  b2[facei] = cos(acos(a12[facei]) - theta[facei]);
472  }
473 
474  scalarField det(1 - a12*a12);
475 
476  scalarField a((b1 - a12*b2)/det);
477  scalarField b((b2 - a12*b1)/det);
478 
479  nHatPatch = a*AfHatPatch + b*nHatPatch;
480 
481  nHatPatch /= (mag(nHatPatch) + deltaN_.value());
482  }
483  }
484 }
485 
486 
487 Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
488 (
489  const phaseModel& phase1,
490  const phaseModel& phase2
491 ) const
492 {
493  tmp<surfaceVectorField> tnHatfv = nHatfv(phase1, phase2);
494 
495  correctContactAngle(phase1, phase2, tnHatfv.ref().boundaryFieldRef());
496 
497  // Simple expression for curvature
498  return -fvc::div(tnHatfv & mesh_.Sf());
499 }
500 
501 
502 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
503 
505 (
506  const fvMesh& mesh
507 )
508 :
509  phaseSystem(mesh),
510 
511  alphas_
512  (
513  IOobject
514  (
515  "alphas",
516  mesh_.time().timeName(),
517  mesh,
518  IOobject::NO_READ,
519  IOobject::AUTO_WRITE
520  ),
521  mesh,
522  dimensionedScalar("alphas", dimless, 0.0)
523  ),
524 
525  cAlphas_(lookup("interfaceCompression")),
526 
527  deltaN_
528  (
529  "deltaN",
530  1e-8/pow(average(mesh_.V()), 1.0/3.0)
531  )
532 {
533  forAll(phases(), phasei)
534  {
535  volScalarField& alphai = phases()[phasei];
536  mesh_.setFluxRequired(alphai.name());
537  }
538 }
539 
540 
541 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
542 
544 {}
545 
546 
547 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
548 
550 (
551  const phaseModel& phase1
552 ) const
553 {
554  tmp<surfaceScalarField> tSurfaceTension
555  (
557  (
558  IOobject
559  (
560  "surfaceTension",
561  mesh_.time().timeName(),
562  mesh_
563  ),
564  mesh_,
566  (
567  "surfaceTension",
568  dimensionSet(1, -2, -2, 0, 0),
569  0
570  )
571  )
572  );
573 
574  forAll(phases(), phasej)
575  {
576  const phaseModel& phase2 = phases()[phasej];
577 
578  if (&phase2 != &phase1)
579  {
580  phasePairKey key12(phase1.name(), phase2.name());
581 
582  cAlphaTable::const_iterator cAlpha(cAlphas_.find(key12));
583 
584  if (cAlpha != cAlphas_.end())
585  {
586  tSurfaceTension.ref() +=
587  fvc::interpolate(sigma(key12)*K(phase1, phase2))
588  *(
589  fvc::interpolate(phase2)*fvc::snGrad(phase1)
590  - fvc::interpolate(phase1)*fvc::snGrad(phase2)
591  );
592  }
593  }
594  }
595 
596  return tSurfaceTension;
597 }
598 
599 
602 {
603  tmp<volScalarField> tnearInt
604  (
605  new volScalarField
606  (
607  IOobject
608  (
609  "nearInterface",
610  mesh_.time().timeName(),
611  mesh_
612  ),
613  mesh_,
614  dimensionedScalar("nearInterface", dimless, 0.0)
615  )
616  );
617 
618  forAll(phases(), phasei)
619  {
620  tnearInt.ref() = max
621  (
622  tnearInt(),
623  pos0(phases()[phasei] - 0.01)*pos0(0.99 - phases()[phasei])
624  );
625  }
626 
627  return tnearInt;
628 }
629 
630 
632 {
633  const Time& runTime = mesh_.time();
634 
635  const dictionary& alphaControls = mesh_.solverDict("alpha");
636  label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));
637 
638  bool LTS = fv::localEulerDdt::enabled(mesh_);
639 
640  if (nAlphaSubCycles > 1)
641  {
642  tmp<volScalarField> trSubDeltaT;
643 
644  if (LTS)
645  {
646  trSubDeltaT =
648  }
649 
650  PtrList<volScalarField> alpha0s(phases().size());
651  PtrList<surfaceScalarField> alphaPhiSums(phases().size());
652 
653  forAll(phases(), phasei)
654  {
655  phaseModel& phase = phases()[phasei];
656  volScalarField& alpha = phase;
657 
658  alpha0s.set
659  (
660  phasei,
661  new volScalarField(alpha.oldTime())
662  );
663 
664  alphaPhiSums.set
665  (
666  phasei,
668  (
669  IOobject
670  (
671  "phiSum" + alpha.name(),
672  runTime.timeName(),
673  mesh_
674  ),
675  mesh_,
676  dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
677  )
678  );
679  }
680 
681  for
682  (
683  subCycleTime alphaSubCycle
684  (
685  const_cast<Time&>(runTime),
687  );
688  !(++alphaSubCycle).end();
689  )
690  {
691  solveAlphas();
692 
693  forAll(phases(), phasei)
694  {
695  alphaPhiSums[phasei] += phases()[phasei].alphaPhi();
696  }
697  }
698 
699  forAll(phases(), phasei)
700  {
701  phaseModel& phase = phases()[phasei];
702  if (phase.stationary()) continue;
703 
704  volScalarField& alpha = phase;
705 
706  phase.alphaPhiRef() = alphaPhiSums[phasei]/nAlphaSubCycles;
707 
708  // Correct the time index of the field
709  // to correspond to the global time
710  alpha.timeIndex() = runTime.timeIndex();
711 
712  // Reset the old-time field value
713  alpha.oldTime() = alpha0s[phasei];
714  alpha.oldTime().timeIndex() = runTime.timeIndex();
715  }
716  }
717  else
718  {
719  solveAlphas();
720  }
721 
722  forAll(phases(), phasei)
723  {
724  phaseModel& phase = phases()[phasei];
725  if (phase.stationary()) continue;
726 
727  phase.alphaRhoPhiRef() =
728  fvc::interpolate(phase.rho())*phase.alphaPhi();
729 
730  phase.maxMin(0, 1);
731  }
732 
733  calcAlphas();
734 }
735 
736 
737 // ************************************************************************* //
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
dimensionedScalar tanh(const dimensionedScalar &ds)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
dimensionedScalar acos(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
zeroField Su
Definition: alphaSuSp.H:1
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
label phasei
Definition: pEqn.H:27
error FatalError
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
multiphaseSystem::phaseModelList & phases
Definition: createFields.H:12
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
static tmp< volScalarField > localRSubDeltaT(const fvMesh &mesh, const label nAlphaSubCycles)
Calculate and return the reciprocal of the local sub-cycling.
Definition: localEulerDdt.C:70
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
Calculate the matrix for the laplacian of the field.
Calculate the snGrad of the given volField.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
CGAL::Exact_predicates_exact_constructions_kernel K
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:210
Calculate the first temporal derivative.
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
stressControl lookup("compactNormalStress") >> compactNormalStress
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
const phaseModel & phase() const
Return the phase.
dynamicFvMesh & mesh
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
Definition: localEulerDdt.C:37
dimensionedScalar cos(const dimensionedScalar &ds)
const dictionary & alphaControls
Definition: alphaControls.H:1
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
Definition: MULES.C:30
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Calculate the face-flux of the given field.
static word groupName(Name name, const word &group)
Calculate the matrix for the first temporal derivative.
const Type & value() const
Return const reference to value.
word timeName
Definition: getTimeIndex.H:3
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
faceListList boundary(nPatches)
Calculate the field for explicit evaluation of implicit and explicit sources.
void solve()
Solve for the mixture phase-fractions.
label readLabel(Istream &is)
Definition: label.H:64
phaseModel & phase1
Calculate the divergence of the given field.
dimensionedScalar pos0(const dimensionedScalar &ds)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
bool LTS
Definition: createRDeltaT.H:1
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
PtrList< surfaceScalarField > alphafs(phases.size())
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label patchi
virtual surfaceScalarField & alphaPhiRef()=0
Access the volumetric flux of the phase.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:188
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
surfaceScalarField phic(mixture.cAlpha() *mag(phi/mesh.magSf()))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
messageStream Info
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
MULES: Multidimensional universal limiter for explicit solution.
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:98
phaseModel & phase2
A class for managing temporary objects.
Definition: PtrList.H:53
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:32
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField alphaPhi(phi.name()+alpha1.name(), fvc::flux(phi, alpha1, alphaScheme))
multiphaseSystem(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
virtual ~multiphaseSystem()
Destructor.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
Calculate the matrix for implicit and explicit sources.
Namespace for OpenFOAM.
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")))
zeroField Sp
Definition: alphaSuSp.H:2