scalarTransport.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) 2012-2022 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 "scalarTransport.H"
27 #include "surfaceFields.H"
28 #include "fvmDdt.H"
29 #include "fvcDdt.H"
30 #include "fvmDiv.H"
31 #include "fvmLaplacian.H"
32 #include "fvmSup.H"
33 #include "fvcFlux.H"
34 #include "fvModels.H"
35 #include "fvConstraints.H"
38 
39 #include "CMULES.H"
40 #include "EulerDdtScheme.H"
41 #include "localEulerDdtScheme.H"
42 #include "CrankNicolsonDdtScheme.H"
43 #include "subCycle.H"
44 #include "interfaceCompression.H"
45 
47 
48 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace functionObjects
53 {
54  defineTypeNameAndDebug(scalarTransport, 0);
55 
57  (
58  functionObject,
59  scalarTransport,
60  dictionary
61  );
62 }
63 }
64 
65 
66 template<>
67 const char* Foam::NamedEnum
68 <
70  3
71 >::names[] =
72 {
73  "none",
74  "constant",
75  "viscosity"
76 };
77 
78 const Foam::NamedEnum
79 <
81  3
82 > Foam::functionObjects::scalarTransport::diffusionTypeNames_;
83 
84 
85 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
86 
88 Foam::functionObjects::scalarTransport::D() const
89 {
90  const word Dname("D" + fieldName_);
91 
92  if (diffusion_ == diffusionType::constant)
93  {
94  return volScalarField::New
95  (
96  Dname,
97  mesh_,
99  );
100  }
101  else
102  {
104  mesh_.lookupObject<momentumTransportModel>
105  (
106  momentumTransportModel::typeName
107  );
108 
109  return alphal_*turbulence.nu() + alphat_*turbulence.nut();
110  }
111 }
112 
113 
114 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
115 
117 (
118  const word& name,
119  const Time& runTime,
120  const dictionary& dict
121 )
122 :
123  fvMeshFunctionObject(name, runTime, dict),
124  fieldName_(dict.lookupOrDefault<word>("field", "s")),
125  diffusion_(diffusionType::none),
126  D_(0),
127  nCorr_(0),
128  s_
129  (
130  IOobject
131  (
132  fieldName_,
133  mesh_.time().timeName(),
134  mesh_,
137  ),
138  mesh_
139  ),
140  MULES_(false),
141  deltaN_
142  (
143  "deltaN",
144  1e-8/pow(average(mesh_.V()), 1.0/3.0)
145  ),
146  sRestart_(false)
147 {
148  read(dict);
149 
150  if (mesh_.solution().solversDict().found(fieldName_))
151  {
152  const dictionary& controls = mesh_.solution().solverDict(fieldName_);
153 
154  if (controls.found("nSubCycles"))
155  {
156  MULES_ = true;
157 
159  (
160  IOobject::groupName("sPhi", s_.group()),
161  runTime.timeName(),
162  mesh_,
165  );
166 
167  sRestart_ = sPhiHeader.headerOk();
168 
169  if (sRestart_)
170  {
171  Info << "Restarting s" << endl;
172  }
173 
174  const surfaceScalarField& phi =
175  mesh_.lookupObject<surfaceScalarField>(phiName_);
176 
177  // Scalar volumetric flux
178  tsPhi_ = new surfaceScalarField
179  (
180  sPhiHeader,
181  phi*fvc::interpolate(s_)
182  );
183 
184  if (controls.lookupOrDefault<Switch>("MULESCorr", false))
185  {
186  mesh_.schemes().setFluxRequired(fieldName_);
187  }
188  }
189  }
190 }
191 
192 
193 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
194 
196 {}
197 
198 
199 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
200 
202 {
204 
205  phiName_ = dict.lookupOrDefault<word>("phi", "phi");
206  rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
207  schemesField_ = dict.lookupOrDefault<word>("schemesField", fieldName_);
208 
209  diffusion_ = diffusionTypeNames_.read(dict.lookup("diffusion"));
210 
211  switch(diffusion_)
212  {
213  case diffusionType::none:
214  break;
215 
216  case diffusionType::constant:
217  dict.lookup("D") >> D_;
218  break;
219 
221  dict.lookup("alphal") >> alphal_;
222  dict.lookup("alphat") >> alphat_;
223  break;
224  }
225 
226  dict.readIfPresent("nCorr", nCorr_);
227 
228  return true;
229 }
230 
231 
233 {
234  return wordList{phiName_};
235 }
236 
237 
239 {
240  Info<< type() << " write:" << endl;
241 
242  const surfaceScalarField& phi =
243  mesh_.lookupObject<surfaceScalarField>(phiName_);
244 
245  const word divScheme("div(phi," + schemesField_ + ")");
246 
247  // Set under-relaxation coeff
248  scalar relaxCoeff = 0.0;
249  if (mesh_.solution().relaxEquation(schemesField_))
250  {
251  relaxCoeff = mesh_.solution().equationRelaxationFactor(schemesField_);
252  }
253 
256  (
258  );
259 
260  if (phi.dimensions() == dimVolume/dimTime)
261  {
262  if (MULES_)
263  {
264  subCycleMULES();
265 
266  fvConstraints.constrain(s_);
267  }
268  else
269  {
270  for (int i=0; i<=nCorr_; i++)
271  {
272  fvScalarMatrix sEqn
273  (
274  fvm::ddt(s_)
275  + fvm::div(phi, s_, divScheme)
276  ==
277  fvModels.source(s_)
278  );
279 
280  if (diffusion_ != diffusionType::none)
281  {
282  sEqn -= fvm::laplacian(D(), s_);
283  }
284 
285  sEqn.relax(relaxCoeff);
286 
287  fvConstraints.constrain(sEqn);
288 
289  sEqn.solve(schemesField_);
290 
291  fvConstraints.constrain(s_);
292  }
293  }
294  }
295  else if (phi.dimensions() == dimMass/dimTime)
296  {
297  const volScalarField& rho =
298  mesh_.lookupObject<volScalarField>(rhoName_);
299 
300  for (int i=0; i<=nCorr_; i++)
301  {
302  fvScalarMatrix sEqn
303  (
304  fvm::ddt(rho, s_)
305  + fvm::div(phi, s_, divScheme)
306  ==
307  fvModels.source(rho, s_)
308  );
309 
310  if (diffusion_ != diffusionType::none)
311  {
312  sEqn -= fvm::laplacian(rho*D(), s_);
313  }
314 
315  sEqn.relax(relaxCoeff);
316 
317  fvConstraints.constrain(sEqn);
318 
319  sEqn.solve(schemesField_);
320 
321  fvConstraints.constrain(s_);
322  }
323  }
324  else
325  {
327  << "Incompatible dimensions for phi: " << phi.dimensions() << nl
328  << "Dimensions should be " << dimMass/dimTime << " or "
330  }
331 
332  Info<< endl;
333 
334  return true;
335 }
336 
337 
338 void Foam::functionObjects::scalarTransport::subCycleMULES()
339 {
340  const dictionary& controls = mesh_.solution().solverDict(fieldName_);
341  const label nSubCycles(controls.lookup<label>("nSubCycles"));
342  const bool LTS = fv::localEulerDdt::enabled(mesh_);
343 
344  if (nSubCycles > 1)
345  {
346  tmp<volScalarField> trSubDeltaT;
347 
348  if (LTS)
349  {
350  trSubDeltaT =
351  fv::localEulerDdt::localRSubDeltaT(mesh_, nSubCycles);
352  }
353 
354  for
355  (
356  subCycle<volScalarField> sSubCycle(s_, nSubCycles);
357  !(++sSubCycle).end();
358  )
359  {
360  solveMULES();
361  }
362  }
363  else
364  {
365  solveMULES();
366  }
367 
368 
369  // Apply the diffusion term separately to allow implicit solution
370  // and boundedness of the explicit advection
371  if (diffusion_ != diffusionType::none)
372  {
373  fvScalarMatrix sEqn
374  (
375  fvm::ddt(s_) - fvc::ddt(s_)
376  - fvm::laplacian(D(), s_)
377  );
378 
379  sEqn.solve(controls.subDict("diffusion"));
380 
381  Info<< fieldName_ << " volume fraction = "
382  << s_.weightedAverage(mesh_.V()).value()
383  << " Min(" << fieldName_ << ") = " << min(s_).value()
384  << " Max(" << fieldName_ << ") = " << max(s_).value()
385  << endl;
386  }
387 }
388 
389 
390 void Foam::functionObjects::scalarTransport::solveMULES()
391 {
392  const dictionary& controls = mesh_.solution().solverDict(fieldName_);
393  const label nCorr(controls.lookup<label>("nCorr"));
394  const label nSubCycles(controls.lookup<label>("nSubCycles"));
395  const bool MULESCorr(controls.lookupOrDefault<Switch>("MULESCorr", false));
396 
397  // Apply the compression correction from the previous iteration
398  // Improves efficiency for steady-simulations but can only be applied
399  // once the s field is reasonably steady, i.e. fully developed
400  const bool applyPrevCorr
401  (
402  controls.lookupOrDefault<Switch>("applyPrevCorr", false)
403  );
404 
405  const bool LTS = fv::localEulerDdt::enabled(mesh_);
406 
407  const word divScheme("div(phi," + schemesField_ + ")");
408 
409  const surfaceScalarField& phi =
410  mesh_.lookupObject<surfaceScalarField>(phiName_);
411 
412  surfaceScalarField& sPhi_ = tsPhi_.ref();
413 
414  const word sScheme(mesh_.schemes().div(divScheme)[1].wordToken());
415 
416  // If a compressive convection scheme is used
417  // the interface normal must be cached
419 
420  if (compressionSchemes.found(sScheme))
421  {
422  const surfaceVectorField gradsf(fvc::interpolate(fvc::grad(s_)));
423 
424  nHatf = new surfaceScalarField
425  (
426  IOobject
427  (
428  "nHatf",
429  s_.time().timeName(),
430  mesh_
431  ),
432  gradsf/(mag(gradsf) + deltaN_) & mesh_.Sf()
433  );
434  }
435 
436  // Set the off-centering coefficient according to ddt scheme
437  scalar ocCoeff = 0;
438  {
440  (
442  (
443  mesh_,
444  mesh_.schemes().ddt("ddt(s)")
445  )
446  );
447  const fv::ddtScheme<scalar>& ddtS = tddtS();
448 
449  if
450  (
453  )
454  {
455  ocCoeff = 0;
456  }
458  {
459  if (nSubCycles > 1)
460  {
462  << "Sub-cycling is not supported "
463  "with the CrankNicolson ddt scheme"
464  << exit(FatalError);
465  }
466 
467  if
468  (
469  sRestart_
470  || mesh_.time().timeIndex() > mesh_.time().startTimeIndex() + 1
471  )
472  {
473  ocCoeff =
474  refCast<const fv::CrankNicolsonDdtScheme<scalar>>(ddtS)
475  .ocCoeff();
476  }
477  }
478  else
479  {
481  << "Only Euler and CrankNicolson ddt schemes are supported"
482  << exit(FatalError);
483  }
484  }
485 
486  // Set the time blending factor, 1 for Euler
487  scalar cnCoeff = 1.0/(1.0 + ocCoeff);
488 
490 
491  // Calculate the Crank-Nicolson off-centred volumetric flux
492  if (ocCoeff > 0)
493  {
495  (
496  "phiCN",
497  cnCoeff*phi + (1.0 - cnCoeff)*phi.oldTime()
498  );
499  }
500 
501  if (MULESCorr)
502  {
503  fvScalarMatrix sEqn
504  (
505  (
506  LTS
507  ? fv::localEulerDdtScheme<scalar>(mesh_).fvmDdt(s_)
508  : fv::EulerDdtScheme<scalar>(mesh_).fvmDdt(s_)
509  )
511  (
512  mesh_,
513  phiCN,
514  upwind<scalar>(mesh_, phiCN)
515  ).fvmDiv(phiCN, s_)
516  );
517 
518  sEqn.solve();
519 
520  Info<< fieldName_ << " volume fraction = "
521  << s_.weightedAverage(mesh_.Vsc()).value()
522  << " Min(" << fieldName_ << ") = " << min(s_).value()
523  << " Max(" << fieldName_ << ") = " << max(s_).value()
524  << endl;
525 
526  tmp<surfaceScalarField> tsPhiUD(sEqn.flux());
527  sPhi_ = tsPhiUD();
528 
529  if (applyPrevCorr && tsPhiCorr0_.valid())
530  {
531  Info<< "Applying the previous iteration compression flux" << endl;
533  (
535  s_,
536  sPhi_,
537  tsPhiCorr0_.ref(),
538  oneField(),
539  zeroField()
540  );
541 
542  sPhi_ += tsPhiCorr0_();
543  }
544 
545  // Cache the upwind-flux
546  tsPhiCorr0_ = tsPhiUD;
547  }
548 
549  for (int sCorr=0; sCorr<nCorr; sCorr++)
550  {
551  // Split operator
553  (
554  fvc::flux
555  (
556  phiCN(),
557  (cnCoeff*s_ + (1.0 - cnCoeff)*s_.oldTime())(),
558  mesh_.schemes().div(divScheme)
559  )
560  );
561 
562  if (MULESCorr)
563  {
564  tmp<surfaceScalarField> tsPhiCorr(tsPhiUn() - sPhi_);
565  volScalarField s0("s0", s_);
566 
568  (
570  s_,
571  tsPhiUn(),
572  tsPhiCorr.ref(),
573  oneField(),
574  zeroField()
575  );
576 
577  // Under-relax the correction for all but the 1st corrector
578  if (sCorr == 0)
579  {
580  sPhi_ += tsPhiCorr();
581  }
582  else
583  {
584  s_ = 0.5*s_ + 0.5*s0;
585  sPhi_ += 0.5*tsPhiCorr();
586  }
587  }
588  else
589  {
590  sPhi_ = tsPhiUn;
591 
593  (
595  s_,
596  phiCN,
597  sPhi_,
598  oneField(),
599  zeroField()
600  );
601  }
602  }
603 
604  if (applyPrevCorr && MULESCorr)
605  {
606  tsPhiCorr0_ = sPhi_ - tsPhiCorr0_;
607  tsPhiCorr0_.ref().rename("sPhiCorr0");
608  }
609  else
610  {
611  tsPhiCorr0_.clear();
612  }
613 
614  if
615  (
616  word(mesh_.schemes().ddt("ddt(s)"))
618  )
619  {
620  if (ocCoeff > 0)
621  {
622  // Calculate the end-of-time-step s flux
623  sPhi_ = (sPhi_ - (1.0 - cnCoeff)*sPhi_.oldTime())/cnCoeff;
624  }
625  }
626 
627  Info<< fieldName_ << "volume fraction = "
628  << s_.weightedAverage(mesh_.Vsc()).value()
629  << " Min(" << fieldName_ << ") = " << min(s_).value()
630  << " Max(" << fieldName_ << ") = " << max(s_).value()
631  << endl;
632 }
633 
634 
636 {
637  return true;
638 }
639 
640 
641 // ************************************************************************* //
Local time-step first-order Euler implicit/explicit ddt.
Foam::surfaceFields.
const dimensionSet dimViscosity
Second-oder Crank-Nicolson implicit ddt using the current and previous time-step fields as well as th...
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:663
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
bool headerOk()
Read header (uses typeGlobalFile to find file) and check.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
T & ref() const
Return non-const reference or generate a fatal error.
Definition: tmpI.H:181
Templated form of IOobject providing type information for file reading and header type checking...
Definition: IOobject.H:537
static tmp< volScalarField > localRSubDeltaT(const fvMesh &mesh, const label nAlphaSubCycles)
Calculate and return the reciprocal of the local sub-cycling.
Definition: localEulerDdt.C:70
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
const wordHashSet compressionSchemes
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
Calculate the matrix for the laplacian of the field.
Initialise the NamedEnum HashTable from the static list of names.
Definition: NamedEnum.H:51
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
diffusionType
Enumeration defining the type of the diffusion.
Macros for easy insertion into run-time selection tables.
Abstract base class for ddt schemes.
Definition: ddtScheme.H:64
scalarTransport(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:1002
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
virtual bool execute()
Calculate the scalarTransport.
Calculate the first temporal derivative.
const dimensionSet dimTime
const dimensionSet & dimensions() const
Return dimensions.
virtual bool read(const dictionary &)
Read optional controls.
bool read(const char *, int32_t &)
Definition: int32IO.C:85
void correct(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su)
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
Definition: localEulerDdt.C:37
Foam::fvConstraints & fvConstraints
bool found(const Key &) const
Return true if hashedEntry is found in table.
Definition: HashTable.C:113
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
Definition: zeroField.H:50
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
Definition: Time.C:666
A class for handling words, derived from string.
Definition: word.H:59
Calculate the face-flux of the given field.
static word groupName(Name name, const word &group)
bool isType(const Type &t)
Check the typeid.
Definition: typeInfo.H:126
Finite volume models.
Definition: fvModels.H:60
Info<< "Reading field p\"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, simple.dict());mesh.schemes().setFluxRequired(p.name());Info<< "Reading field pa\"<< endl;volScalarField pa(IOobject("pa", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field Ua\"<< endl;volVectorField Ua(IOobject("Ua", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);# 65 "/home/ubuntu/OpenFOAM-10/applications/solvers/incompressible/adjointShapeOptimisationFoam/createFields.H" 2label paRefCell=0;scalar paRefValue=0.0;setRefCell(pa, simple.dict(), paRefCell, paRefValue);mesh.schemes().setFluxRequired(pa.name());autoPtr< viscosityModel > viscosity(viscosityModel::New(mesh))
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvmDdt.C:46
Calculate the matrix for the first temporal derivative.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
virtual bool read(const dictionary &)
Read the scalarTransport data.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
phi
Definition: correctPhi.H:3
tmp< surfaceScalarField > phiCN(phi)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
Perform a subCycleTime on a field or list of fields.
Definition: subCycle.H:231
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
SolverPerformance< Type > solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
Definition: fvMatrixSolve.C:58
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
static const char nl
Definition: Ostream.H:260
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmDiv.C:46
bool LTS
Definition: createRDeltaT.H:1
scalar ocCoeff
Definition: alphaEqn.H:5
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
Definition: dictionaryIO.C:96
const dimensionSet dimMass
defineTypeNameAndDebug(Qdot, 0)
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.
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
Internal & ref()
Return a reference to the dimensioned internal field.
Abstract base class for turbulence models (RAS, LES and laminar).
Foam::fvModels & fvModels
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
A class representing the concept of a field of 1 used to avoid unnecessary manipulations for objects ...
Definition: oneField.H:50
Calculate the matrix for the divergence of the given field and flux.
virtual bool write()
Do nothing.
Basic second-order convection using face-gradients and Gauss&#39; theorem.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Finite volume constraints.
Definition: fvConstraints.H:57
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvmLaplacian.C:46
int nCorr
Definition: createControls.H:3
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
const dimensionSet dimVolume
messageStream Info
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar cnCoeff
Definition: alphaEqn.H:55
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
Definition: fvMatrix.C:927
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
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
Basic first-order Euler implicit/explicit ddt using only the current and previous time-step values...
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:98
const bool MULESCorr(alphaControls.lookupOrDefault< Switch >("MULESCorr", false))
virtual wordList fields() const
Return the list of fields required.
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
Calculate the matrix for implicit and explicit sources.
Namespace for OpenFOAM.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:864