Commit Graph

403 Commits

Author SHA1 Message Date
Mark Olesen
ef44df91f2 ENH: support direct lookup of solver controls
OLD:
        pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
        pEqn.solve(mesh.solver("Yi"));

    NEW:
        pEqn.solve(p.select(piso.finalInnerIter()));
        pEqn.solve("Yi");
2023-12-07 17:42:24 +01:00
Mark Olesen
e967305ef2 STYLE: use calculatedType() and zeroGradientType() methods 2023-05-02 13:34:12 +02:00
Mark Olesen
25bc7d65f7 STYLE: prefer REGISTER/NO_REGISTER instead of true/false for IOobject
- self-documenting
2023-03-10 14:16:32 +00:00
Mark Olesen
3d8a6a5433 ENH: use GeometricField clamp_min, clamp_max, clamp_range
- newer naming allows for less confusing code.
  Eg,
      max(lower)  ->  clamp_min(lower)
      min(upper)  ->  clamp_max(upper)

- prefer combined method, for few operations.
  Eg,
      max(lower) + min(upper) -> clamp_range(lower, upper)

  The updated naming also helps avoid some obvious coding errors.
  Eg,

     Re.min(1200.0);
     Re.max(18800.0);

  instead of
     Re.clamp_range(1200.0, 18800.0);

- can also use implicit conversion of zero_one to MinMax<Type> for
  this type of code:

      lambda_.clamp_range(zero_one{});
2023-02-21 10:05:26 +01:00
Mark Olesen
097008544c STYLE: adjust range check in Foam::factorial (FULLDEBUG)
STYLE: consistent use of $(LIB_SRC) in Make/options
2022-09-07 16:25:45 +02:00
sergio
9a80d0d5ef ENH: thermoTools: new library for thermophysics tools
thermoTools is a relocation of various existing tools:

- src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/
- src/semiPermeableBaffle/derivedFvPatchFields/
- src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/

ENH: Allwmake: reordering various compilation steps

Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2022-06-21 09:29:13 +01:00
Mark Olesen
8b63b8cdfe ENH: add hashedWordList find, appendUniq methods
- aligns calling signatures with wordList, for possible future
  replacement

- drop construct from const char** (can use initializer_list instead)

ENH: replace hashedWordList with plain wordList in triSurfaceLoader

- additional hashing optimisation (and overhead) is not worth it for
  the comparatively small lists of surfaces used.
2022-06-02 11:14:10 +02:00
sergio
02b8862de7 BUG: Making surfaceFilmProperties optional for postProcessing. Fixes #2372 2022-04-13 15:55:29 -07:00
Andrew Heather
8be3f3d910 BUG: Corrected ddtCorr switch - see #2183 2021-08-17 15:36:34 +01:00
Kutalmis Bercin
3207e315b2 ENH: enable custom input of U for devRhoReff and devReff 2021-08-05 12:40:47 +00:00
sergio
a9aa6cb0db ENH: kinematicParcelFoam: new solver and tutorial
The original thermoSurfaceFilm sub-models were divided between kinematicSurfaceFilm and thermoSurfaceFilm in order to use the surfaceFilm model in a kinematicCloud.

The film interaction models are now in a kinematicSurface class which can be used in a kinematic cloud adding constant thermal properties (p and T) for some sub-models, e.g. drySplashInteraction/wetSplashInteraction.

pRef and Tref were added to the kinematicSurfaceFilm as entry to the regionFilm when used with a kinematic cloud.

In the finite area surface film model Tref, pRef are stored in filmSubModelBase.

TUT: kinematicParcelFoam: new tutorial pitzDailySprinkles
2021-07-16 16:38:06 +00:00
sergio
384b9f8100 ENH: reactingParcelFoam: allow to run single species 2021-07-16 16:38:06 +00:00
sergio
b62306ddc5 ENH: Adding regionFaModels library to solvers 2021-07-16 16:38:06 +00:00
Mark Olesen
6a390f6ad1 COMP: remove includes of defunct locations (fixes #2143) 2021-06-29 13:43:44 +02:00
Kutalmis Bercin
0256e20da3 BUG: reactingParcelFoam: missing entry required for dynamic mesh motion (#2019) 2021-03-04 12:41:21 +01:00
Kutalmis Bercin
5e539b30a9 INT: reactingParcelFoam: add dynamicMeshMotion capabilities 2020-12-18 11:58:09 +00:00
Sergio Ferraris
06a0bf1868 TUT: Adding new MPPICDyMFoam and uncoupledKinematicParcelDyMFoam tutorials
STY: Style and header-content changes
2020-12-17 21:17:03 +00:00
Sergio Ferraris
6d4e72dc3f ENH: Using basicKinematicCloud for MPPICFoam and MPPICDyMFoam 2020-12-17 21:17:03 +00:00
sergio
66865b9fbc BUG: Correcting include path for MPPICFoam 2020-12-17 09:51:11 -08:00
sergio
260db42f7f BUG: Correcting DPMIncompressibleTurbulenceModel in DPM solvers 2020-12-17 09:26:56 -08:00
Sergio Ferraris
3db12bbdef ENH: adding non-uniform rho to incompressible two-phase turbulent models
1) PhaseIncompressibleTurbulenceModel class was changed to use
   uniform alpha and non-uniform rho templates. This fits the need
   of incompressible two phase turbulence models.

2) A new type DPMIncompressibleTurbulenceModel was created for
   non-uniform alpha and uniform rho. It is  used in single phase flows
   in DPM solvers where alpha represents the volumen occupancy.

3) A new type incompressibleRhoTurbulenceModel  was created where
   non-uniform rho is allowed.

4) A new base templated turbulent class for two-phase VOF named
   VoFphaseTurbulentTransportModel was implemented which is created
   templating on PhaseIncompressibleTurbulenceModel and
   incompressibleRhoTurbulenceModel

5) In order to make the chnage to rho based VOF turbulence a help
   class was added incompressibleInterPhaseTransportModel templated
   on the mixing.
2020-12-16 17:57:45 +00:00
Mark Olesen
b2bded48c9 STYLE: use Time::printExecutionTime() method
- makes format of ExecutionTime = ... output configurable (#788)
  and reduces code clutter.

STYLE: more consistent line-breaks after "End" tag
2020-08-07 09:24:56 +02:00
Mark Olesen
03526e2097 ENH: centralize more libraries in src/phaseSystemModels
- prelude to code refactoring

NOTE
    no source code change in this commit, only relocation,
    renaming and adjustment of Make/{files,options}
2020-08-05 18:56:22 +01:00
Mark Olesen
6b074985ac ENH: improve separation of turbulence models macros (define vs make) 2020-08-03 16:28:21 +02:00
Andrew Heather
013a52238d COMP: some resolved compiler warnings 2020-06-25 10:02:50 +01:00
OpenFOAM bot
01ec92fd35 GIT: remove leading/trailing blank lines, trailing whitespace 2020-06-17 10:46:26 +02:00
Mark Olesen
3e43edf056 ENH: unify use of dictionary method names
- previously introduced `getOrDefault` as a dictionary _get_ method,
  now complete the transition and use it everywhere instead of
  `lookupOrDefault`. This avoids mixed usage of the two methods that
  are identical in behaviour, makes for shorter names, and promotes
  the distinction between "lookup" access (ie, return a token stream,
  locate and return an entry) and "get" access (ie, the above with
  conversion to concrete types such as scalar, label etc).
2020-06-02 17:26:03 +02:00
Mark Olesen
31b172217c ENH: support predicate checks for argList (similar to dictionary methods)
- Favour use of argList methods that are more similar to dictionary
  method names with the aim of reducing the cognitive load.

  * Silently deprecate two-parameter get() method in favour of the
    more familiar getOrDefault.
  * Silently deprecate opt() method in favour of get()

  These may be verbosely deprecated in future versions.
2020-06-02 13:51:18 +02:00
Mark Olesen
595579e01d COMP: use -iquotedir for including the local '.' directory
- adds into the include-quoted search list instead the general (-Idir)
  search list.

  * makes it less subject to ordering (since it will now generally be
    searched first) and makes it less subject to how duplicate removal
    is implemented. In some compilers (#1627), the last instance of
    a duplicate directory would be used and not the first instance.

  * removes clutter in some Make/options files

COMP: add missing linkage libraries
2020-05-06 13:06:40 +02:00
Mark Olesen
79048eb68f STYLE: use writeEntry(), beginBlock(), endBlock() methods
- use dictionary::get<..> instead of lookup in a few more places
2020-04-28 10:41:23 +02:00
Andrew Heather
af34e61ef7 ENH: reactingParcelFoam - made film region mesh available for postProcess 2020-03-26 21:27:44 +00:00
Mark Olesen
1310e85225 ENH: support 'get()' for retrieving argList options
- previously only had 'opt<..>()' for options, but 'get<..>()'
  provides more similarity with dictionary methods.
  The 'opt<..>()' method is retained.
2019-11-26 21:07:11 +01:00
Mark Olesen
98467036b3 STYLE: regularize quoting and exit on failed 'cd' 2019-11-13 13:19:16 +01:00
Mark Olesen
ec7e3c88e4 ENH: test for WM_PROJECT_DIR being set/unset in scripts 2019-11-06 09:18:51 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
sergio
25575df60e ENH: new ReactingHeterogeneousCloud
- number of particles per parcel info to kinematic cloud

- added turbulent dispersion to basicHeterogeneousReactingParcel

- corrected dhsTrans in MUCSheterogeneousRate::calculate

- added cloud macro system to reactingParcelFoam and fixed calculation
  of average particles per parcel

- added progress variable dimension to reacting model (nF)

- added ReactingHeterogeneous tutorial
2019-01-04 17:08:53 -08:00
Mark Olesen
beefee48d4 COMP: adjust compilation order with updated interdependencies
- Eg, with surface writers now in surfMesh, there are fewer libraries
  depending on conversion and sampling.

COMP: regularize linkage ordering and avoid some implicit linkage (#1238)
2019-04-28 14:44:33 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
9a7029004c ENH: minMax, minMaxMag as functions and field functions
- Global functions are unary or combining binary functions, which are
  defined in MinMax.H (MinMaxOps.H).

  There are also global reduction functions (gMinMax, gMinMaxMag)
  as well as supporting 'Op' classes:

  - minMaxOp, minMaxEqOp, minMaxMagOp, minMaxMagEqOp

  Since the result of the functions represents a content reduction
  into a single MinMax<T> value (a min/max pair), field operations
  returning a field simply do not make sense.

- Implemented for lists, fields, field-fields, DimensionedField,
  GeometricField (parallel reducing, with boundaries).

- Since the minMax evaluates during its operation, this makes it more
  efficient for cases where both min/max values are required since it
  avoids looping twice through the data.

  * Changed GeometricField writeMinMax accordingly.

ENH: clip as field function

- clipping provides a more efficient, single-pass operation to apply
  lower/upper limits on single or multiple values.

  Examples,

    scalarMinMax limiter(0, 1);

    limiter.clip(value)

       -> returns a const-ref to the value if within the range, or else
          returns the appropriate lower/upper limit

    limiter.inplaceClip(value)

       -> Modifies the value if necessary to be within lower/upper limit

  Function calls

    clip(value, limiter)

       -> returns a copy after applying lower/upper limit

    clip(values, limiter)

       -> returns a tmp<Field> of clipped values
2019-01-10 09:43:23 +01:00
Mark Olesen
6a448016aa ENH: additional read guards for dimensionedType. input consistency (#762, #1148)
- provide a lookupOrDefault constructor form, since this is a fairly
  commonly used requirement and simplifies the calling sequence.

  Before

      dimensionedScalar rhoMax
      (
          dimensionedScalar::lookupOrDefault
          (
              "rhoMax",
              pimple.dict(),
              dimDensity,
              GREAT
          )
     );

  After

      dimensionedScalar rhoMax("rhoMax", dimDensity, GREAT, pimple.dict());

- read, readIfPresent methods with alternative lookup names.

- Mark the Istream related constructors with compile-time deprecated
  warnings.

BUG: read, readIfPresent methods not handling optional dimensions (#1148)
2019-01-03 13:34:11 +01:00
Mark Olesen
5d9e278e92 ENH: consolidate handling of mandatory/optional command arguments
- for some special cases we wish to mark command-line arguments as
  being optional, in order to do our own treatment. For example,
  when an arbitrary number of arguments should be allowed.

  Now tag this situation with argList::noMandatoryArgs().
  The argList::argsMandatory() query can then be used in any further
  logic, including the standard default argument checking.

- with the new default check, can consolidate the special-purpose

      "setRootCaseNonMandatoryArgs.H"

  into the regular

      "setRootCase.H"

- revert to a simple "setRootCase.H" and move all the listing related
  bits to a "setRootCaseLists.H" file. This leaves the information
  available for solvers, or whoever else wishes, without being
  introduced everywhere.

- add include guards and scoping to the listing files and rename to
  something less generic.

     listOptions.H -> setRootCaseListOptions.H
     listOutput.H  -> setRootCaseListOutput.H
2018-12-13 01:45:09 +01:00
Mark Olesen
29a5793b5b STYLE: argList::opt method instead of the longer argList::lookupOrDefault
- also replaced a few instances of readIfPresent with opt<> for
  constant values.
2018-12-12 12:10:39 +01:00
Mark Olesen
68ec561df8 STYLE: add usage notes to more utilities and solvers 2018-12-11 15:25:27 +01:00
Mark Olesen
dd87c98393 ENH: add read guard for dimensionedType constructors (#762)
- deprecate dimensionedType constructors using an Istream in favour of
  versions accepting a keyword and a dictionary.

  Dictionary entries are almost the exclusive means of read
  constructing a dimensionedType. By construct from the dictionary
  entry instead of doing a lookup() first, we can detect possible
  input errors such as too many tokens as a result of a input syntax
  error.

  Constructing a dimensionedType from a dictionary entry now has
  two forms.

  1.  dimensionedType(key, dims, dict);

      This is the constructor that will normally be used.

      It accepts entries with optional leading names and/or
      dimensions. If the entry contains dimensions, they are
      verified against the expected dimensions and an IOError is
      raised if they do not correspond. On conclusion, checks the
      token stream for any trailing rubbish.

  2.  dimensionedType(key, dict);

      This constructor is used less frequently.

      Similar to the previous description, except that it is initially
      dimensionless. If entry contains dimensions, they are used
      without further verification. The constructor also includes a
      token stream check.

      This constructor is useful when the dimensions are entirely
      defined from the dictionary input, but also when handling
      transition code where the input dimensions are not obvious from
      the source.

      This constructor can also be handy when obtaining values from
      a dictionary without needing to worry about the input dimensions.
      For example,

         Info<< "rho: " << dimensionedScalar("rho", dict).value() << nl;

      This will accept a large range of inputs without hassle.

ENH: consistent handling of dimensionedType for inputs (#1083)

BUG: incorrect Omega dimensions (fixes #2084)
2018-11-20 15:14:10 +01:00
Andrew Heather
8bf7a522e7 BUG: Corrected setting of cloud name 2018-11-02 11:20:07 +00:00
Mark Olesen
4e04c1966f ENH: use dictionary::get<word>() instead of lookup() in a few places 2018-10-19 09:11:31 +02:00
Mark Olesen
8eddcc072a ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033)
- use the dictionary 'get' methods instead of readScalar for
  additional checking

     Unchecked:  readScalar(dict.lookup("key"));
     Checked:    dict.get<scalar>("key");

- In templated classes that also inherit from a dictionary, an additional
  'template' keyword will be required. Eg,

     this->coeffsDict().template get<scalar>("key");

  For this common use case, the predefined getXXX shortcuts may be
  useful. Eg,

     this->coeffsDict().getScalar("key");
2018-10-12 08:14:47 +02:00
Andrew Heather
0b95bb008c ENH: Refactored simpleReactingParcelFoam and added new simpleSprayFoam 2018-09-17 13:40:21 +01:00
Mark Olesen
0304911921 STYLE: more consistent use of dimensioned Zero, scalar decimal points
- use scalar(0) instead of scalar(0.0) etc
2018-07-13 10:28:48 +02:00
Mark Olesen
2662042d49 ENH: improve controls for Time (issue #910)
- relocate some standard functionality to TimePaths to allow a lighter
  means of managing time directories without using the entire Time
  mechanism.

- optional enableLibs for Time construction (default is on)
  and a corresponding argList::noLibs() and "-no-libs" option

STYLE:

- mark Time::outputTime() as deprecated MAY-2016

- use pre-increment for runTime, although there is no difference in
  behaviour or performance.
2018-07-02 10:20:01 +02:00