Compare commits

...

691 Commits

Author SHA1 Message Date
c5081a26ca TUT: deleting flamePropagationWithObstacles 2021-03-08 10:15:46 -08:00
a8ce8ed6f3 TUT: Updating tutorial for PDRFoam 2021-03-08 10:14:26 -08:00
6a78c3c84e ENH: Adding bounding on b 2021-03-04 15:36:35 -08:00
30eb0014c7 STY: Cleaning up tutorial settings 2021-03-04 17:21:04 +01:00
b38802ea0d INT: update of PDRFoam 2021-03-04 12:34:29 +01:00
9b0f1b67df Merge branch 'thermo-ext' into 'develop'
Thermo ext

See merge request Development/openfoam!424
2021-02-22 16:49:01 +00:00
fcd17db839 COMP: chemkinToFoam: correct dependencies 2021-02-22 10:44:31 +00:00
fcfaf9ba88 ENH: Adding thermo pairs to Lee model 2021-02-22 10:10:11 +00:00
1020991796 ENH: Adding tabutaled type to thermoPhysicsTypes.
Adding thermo options for mass exchange Lee model for multiPhaseInter using
tabulated type of thermos.
2021-02-22 10:10:11 +00:00
125e60ca67 BUG: pointPatch value ignored in vtk, ensight conversion (fixes #2010
- pointPatches may or may not have a "value" type.
  Use the patch value field where possible and the internal field
  otherwise. Previously always used the internal field.
2021-02-19 14:14:11 +01:00
1bb7afc7fe ENH: raw format with optional output for face area normals (#2003)
- the raw surface writer simply outputs x/y/z and field values.
  This additional flag allows recovery of some geometric information.

- optional user-specified output precision

Example,
```
formatOptions
{
    raw
    {
        normal      yes;
        precision   10;
    }
}
```
2021-02-17 13:36:16 +01:00
af80006f97 Merge remote-tracking branch 'origin/master' into develop 2021-02-17 09:39:18 +01:00
66d1b54a79 ENH: 'Math' namespace for mathematical functions
- centralises existing functions (erfInv, incGamma*, invIncGamma*).
  Provides a location for additional functions in the future.

- adjusted existing models to use these functions
  (e.g. distributionModels::normal)
2021-02-16 18:08:50 +01:00
0b1a33e9be ENH: relax the tensor-inverse tolerance on Tensor (FULLDEBUG) 2021-02-16 18:00:16 +01:00
531e8ab66d CONFIG: relocate messageStream output level control to an InfoSwitch
- location and naming more consistent with other controls

    old: DebugSwitch  'level'
    new: InfoSwitch   'outputLevel'
2021-02-16 14:30:36 +01:00
b97cd5c380 ENH: add HashPtrTable release method
- effectively 'steals' the pointer from the table but leaves its
  name as a placeholder
2021-02-16 14:30:36 +01:00
f8a0677a66 ENH: replace base implementation of Foam::Swap with std::swap
- eliminates a potentially invalid code branch.
  Since it essentially had the same internals as std::swap anyhow,
  make that more evident.

ENH: use std::swap for basic types

- makes it clearer that they do not rely on any special semantics
2021-02-16 14:30:36 +01:00
8c460d8ec9 CONFIG: generate flat debian version name 2021-02-16 14:30:36 +01:00
f997013eb8 COMP: include mpi information for versioned cmake build
- since the wrapped cmake calls generally use the regular build
  locations, add in MPI information to properly handle changes
  in that as well. This makes it easier to build for multiple MPI
  instances.
2021-02-16 14:30:36 +01:00
2954f55f6a ENH: improve surfaceFieldValue sampling and writing (#1999)
- ensure surface writing is time-step and nFields aware.
  This avoids overwriting (ignoring) previous output fields.

- allow sampled surfaces to be used for weight fields as well.
  Not sure why this restriction was still there.

- remove old compatibility reading of orientedFields.
  Last used in v1612, now removed.

- only use face sampling. For surfaceFieldValue we can only do
  something meaningful with face values.

ENH: modify interface methods for surfaceWriter

- replace direct modification of values with setter methods.
  Eg,
     old: writer.isPointData() = true;
     new: writer.isPointData(true);

  This makes it possible to add internal hooks to catch state changes.

ENH: allow post-construction change to sampledSurface interpolation

- rename interpolate() method to isPointData() for consistency with
  other classes and to indicate that it is a query.

- additional isPointData(bool) setter method to change the expected
  representation type after construction

- remove 'interpolate' restriction on isoSurfacePoint which was
  previously flagged as an error but within sampledSurfaces can use
  sampleScheme cellPoint and obtain representative samples.
  Relax this restriction since this particular iso-surface algorithm
  is slated for removal in the foreseeable future.
2021-02-16 14:30:19 +01:00
0990d30b73 BUG: Adding relative flux to the mesh 2021-02-15 12:34:49 -08:00
48fdec46c7 BUG: Improving robustness of tracking on cells with detA zero
1) Small modification to the tracking logic for detA zero.
2) Adding small vector displacement to locate function to avoid error where
particle is inserted at the cell centre.
2021-02-15 12:34:49 -08:00
a334aaae78 ENH: noiseModel gainX - protect against very small input frequencies 2021-02-15 12:51:35 +00:00
ae8ccd7b94 BUG: foamToEnsight cellZones missing mesh coverage (closes #2002) 2021-02-15 13:10:01 +01:00
0ee7a23504 CONFIG: ensure PV_PLUGIN_PATH is also in the library path 2021-02-15 13:09:58 +01:00
9913dfb31a CONFIG: bump patch level 2021-02-10 13:48:10 +01:00
77c31a7bef BUG: inconsistent surfaceFieldValue writing (fixes #1999)
- setup writer outside the data loop to ensure that the number of
  output fields is correct (VTK format).

- ignore 'interpolate' on sampled surfaces to ensure proper
  face sampling, never allow point sampling

BUG: incorrect debug-switch for sampledIsoSurface
2021-02-10 13:47:53 +01:00
8f4b080542 ENH: preserve ThirdParty locations in env modules 2021-02-10 12:43:07 +01:00
9f7a400952 GIT: remove old "removed-file" dependency stubs, version file (#1994) 2021-02-10 12:43:07 +01:00
e71bf4445a GIT: fix edit errors 2021-02-10 12:43:07 +01:00
aa9cd50db9 Merge branch 'feature-PtrList' into 'develop'
PtrListOps and adjustments for sync

See merge request Development/openfoam!422
2021-02-09 19:04:04 +00:00
6cdf89dced ENH: use concise forms for walking processor and cyclic boundaries 2021-02-09 17:57:49 +01:00
f24e3f113f ENH: use PtrListOps to reduce code 2021-02-09 16:22:23 +01:00
5080d3cd1f ENH: additional PtrListOps to simplify gathering information
- get: uses access operation to get values for each list item
  Example,
  PtrListOps::get(mesh.boundaryMesh(), nameOp<polyPatch>());

- names: the name() of each list item filtered for matches

- firstMatching: index of first item with a matching name()

- findMatching: indices of items with a matching match name()
  Example,
  PtrListOps::findMatching(mesh.boundaryMesh(), wordRes( ... ));

STYLE: deprecate transitional getNameOp, getTypeOp

- use nameOp, typeOp (word.H) instead
2021-02-09 16:22:23 +01:00
10787d7e82 BUG: particle: use correct celli. Fixes #1992
Was checking the old celli instead of the result of
re-finding the position. See also Foundation commit 50a965f8866683a81d79cbc7811af7333baf9d10.
2021-02-08 10:30:09 +00:00
3941159d6a ENH: polyMesh: fixed error message 2021-02-08 10:30:09 +00:00
4245909efb BUG: typo in etc/colourTables 2021-02-03 15:05:36 +01:00
13152510b3 ENH: surfaceFieldValue - set surface output info for run-time post-processing
If the 'writeFields' option is set in surfaceFieldValue, e.g.

    surface1
    {
        type        surfaceFieldValue;
        libs        (fieldFunctionObjects);
        operation   none;
        fields      (p);
        regionType  patch;
        name        walls;

        // Create a surface in VTK format
        writeFields yes;
        surfaceFormat vtk;
    }

... the surface can now be used in runTimePostProcessing, e.g.:

    surfaces
    {
        surfaceFieldValueOutput
        {
            type            functionObjectSurface;
            representation  surface;
            liveObject      no;
            field           p;
            colourBy        field;
            range           (0 120000);
            functionObject  surface1;
        }
    }

Note: setting 'liveObject' to 'no' to suppress warnings due to the surface
not being retrieved from the object registry (default = 'yes') - this surface
can [currently] only be read from disk.
2021-01-28 16:55:30 +00:00
170d73f4ec STYLE: minor doc update 2021-01-28 16:55:30 +00:00
aa1e1eb15d COMP: fix inline friend declarations (gcc-4.8.5) 2021-01-27 10:33:19 +01:00
8bda4fadbe Merge remote-tracking branch 'origin/master' into develop 2021-01-26 17:06:33 +01:00
d70e11195c BUG: syncTools: incorrect communicator. See #1986 2021-01-26 10:28:12 +01:00
2c7e95d2cb ENH: rename protected UList size(label) -> setAddressableSize(label)
- modification/continuation of 8d63073b08 and 5c1ec7ecb8 (#595).

  Although this protected function is only used internally, the name
  `size(label)` is too easily confused with `resize(label)` and
  `setSize(label)`. The longer method name eliminates some ambiguity.
  Name consistent with PtrListDetail.

- leave size(label) method (for possible compatibility),
  but mark as deprecated

- improve sizing consistency for (Istream >> DynamicList)

STYLE: more consistent use of resize vs setSize in DynamicList

- more consistency between DynamicList and DynamicField.
  There were some inconsistencies in how construct with a size was
  interpreted.

STYLE: more consistent declaration/use of Swap
2021-01-26 09:42:29 +01:00
9b56c6b1ac ENH: consistent noexcept for list iterators and raw-data accessors
- add byteSize to FixedList and Matrix, for possible streaming

ENH: expose data/cdata for PackedList, bitSet
2021-01-26 09:42:27 +01:00
64c6f350ae ENH: simplify packaging of debian orig tarfile, support zstd compression 2021-01-26 09:42:26 +01:00
902f09b688 ENH: IOobject for header generation, preserve output format in datToFoam 2021-01-26 09:42:26 +01:00
0d6de94e8e COMP: ambiguity in IOobject::writeHeader
- a C-string is interpreted as a bool instead of as a word,
  so remove default parameter to eliminate ambiguity
2021-01-26 09:42:26 +01:00
d770ce7aa8 BUG: syncTools: incorrect communicator. See #1986 2021-01-25 18:06:28 +00:00
f88feaf0d4 BUG: surfaceFieldValue fails writing legacy VTK format
- number of fields was not set.
- interpolated surfaces incorrectly written for all formats
2021-01-22 16:20:46 +01:00
c9b34c52bb COMP: bad template for foamNewFunctionObject (closes #1987) 2021-01-22 12:46:31 +01:00
0e7a2d1529 ENH: syncTools: specialisation for contiguous data. Fixes #1986. 2021-01-20 09:33:44 +00:00
648f0593c8 ENH: primitiveMesh: do not copy input storage. See #1963. 2021-01-20 09:33:44 +00:00
81629a44d0 BUG: mapped: access map() for AMI cases. Fixes #1982
Should not call map() since it triggers building the
(one-to-one) mapping which conflicts with the self-contained
mapping of cyclicAMI
2021-01-18 18:19:24 +00:00
71812c21c5 ENH: add 'arch' information to output file headers (ASCII)
- this was previously suppressed for ASCII format as being 'clutter',
  but without it there is no context for interpreting the type of data
  contained in ASCII files: potentially leading to integer overflows
  when reading in ParaView etc.
2021-01-15 15:06:06 +01:00
80bb1b9f57 ENH: use dictionary get<> methods instead of older readScalar + lookup() 2021-01-15 15:06:06 +01:00
d38a4a9177 ENH: correct newlines in DimensionedField output
- orientedType: use explicit constructors, minor cleanup.
2021-01-15 15:06:06 +01:00
5f805b0592 TUT: add decomposeParDict for cavity
- useful for trivial tests
2021-01-15 15:06:06 +01:00
4561717c51 BUG: incorrect returned size from surfaceWriter 2021-01-13 18:05:31 +01:00
b84caecc1e BUG: useless copy of input (primitiveMeshTools::makeCellCentresAndVols) 2021-01-08 08:59:27 +01:00
84a1452995 BUG: Fix dynamicRefineFvMesh mapping flux.
dynamicRefineFvMesh optionally can map fluxes derived from velocities
fields specified in dynamicMeshDict. The surface interpolation was
using old weights. This fix clear the old weights before mapping
the fluxes
2021-01-06 10:22:36 -08:00
c036d4207b ENH: syncTools: edge orientation test. See #1974. 2021-01-06 09:58:17 +00:00
542dae4a6d ENH: syncTools: add edge orientation. Fixes #1974. 2021-01-06 09:54:37 +00:00
f5e689c6a8 BUG: redistributePar: symmetric logic. Fixes #1973. 2021-01-04 14:44:28 +00:00
d2c0c97af8 BUG: redistributePar: symmetric logic. Fixes #1973. 2021-01-04 14:42:10 +00:00
2f449c57ce DOC: adjust wording 2021-01-03 17:21:14 +01:00
0723bcbf8a GIT: reverted version back to 'com' 2020-12-23 10:01:24 +00:00
79e353b84e RELEASE: Updated version to v2012 2020-12-23 10:01:39 +01:00
c536c0fee5 TUT: use scale instead of convertToMeters 2020-12-23 09:21:14 +01:00
1a7fbc3d7f COMP: initialise to nullptr 2020-12-22 21:14:10 +00:00
7a34f29002 DOC: header documentation updates/corrections 2020-12-22 12:15:06 +00:00
77aa2e6026 COMP: corrections to interfaceTrackingFvMesh following commit 14a471f937 2020-12-22 12:15:06 +00:00
bdcc02cf64 TUT: added missing call to tutorial case 2020-12-22 12:15:06 +00:00
7bdb509494 TUT: adjust tutorials for test loop 2020-12-22 12:27:21 +01:00
e58b59ed6f CONFIG: pass through -prefix=false (ie, disable) 2020-12-21 23:52:28 +01:00
5b29be5f9b COMP: fix linkage (mingw) 2020-12-21 23:28:41 +01:00
9f865914e6 Merge branch 'issue-1962-setAlphaField' into 'develop'
BUG: setAlphaField: fix incompatibilities with BCs (#1962)

See merge request Development/openfoam!418
2020-12-21 18:55:40 +00:00
54dfcf5046 BUG: setAlphaField: fix incompatibilities with BCs (#1962)
Co-authored-by: Johan Roenby <johan.roenby@gmail.com>
Co-authored-by: Henning Scheufler <Henning.Scheufler@dlr.de>
2020-12-21 18:55:30 +00:00
e77e4dd462 Merge branch 'feature-surface-film-filmflux-fo' into 'develop'
ENH: Added new filmFlux function object

See merge request Development/openfoam!417
2020-12-21 18:06:57 +00:00
48f8811896 ENH: Added new filmFlux function object
Calculates the mass flux for surface film models.

Example usage:

    filmFlux
    {
        type            filmFlux;
        writeControl    writeTime;
        result          myPhi; // optional
    }
2020-12-21 18:06:57 +00:00
bf3e9b442d TUT: additional sampling planes, iso-surfaces 2020-12-21 18:31:23 +01:00
a2bc1fd3a6 BUG: extrudeMesh: revert previous fix. see #1964
The polyMesh construct-from-components will now ignore
the readOpt for the supplied primitives as before.
This again re-allows READ_IF_PRESENT for fv* in
combination with supplied primitives.
2020-12-21 17:25:56 +00:00
983b7579ee Merge branch 'feature-virtual-init' into 'develop'
Fix cyclicACMI (runtime-selection-geometry, scaling-of-weights)

See merge request Development/openfoam!419
2020-12-21 14:55:00 +00:00
14a471f937 BUG: cyclicACMI: different construction order. See #1953.
This makes the initialisation order of dynamicMesh consistent
with plain ones using the virtual mechanism. It does not
solve the cyclicACMI construction order yet.
2020-12-21 14:54:59 +00:00
18cd5d864e ENH: reinstate Test-decomposePar -cellDist, add -cellDist-internal
- Useful for diagnosis, the -cellDist-internal produces a
  volScalarField::Internal instead
2020-12-21 09:17:37 +01:00
73207dfcd7 BUG: Fixing cloud constructor for MPPICInterFoam 2020-12-20 19:24:12 -08:00
6d6c204745 BUG: extrudeMesh - partial fix for incorrect behaviour - see #1964
Changed IO flag so that new mesh is created
- was using old 'faces', 'owner' etc but then used the new patch starts

Corrected logic for contMap in polyTopoChange
2020-12-18 17:42:20 +00:00
04f3b26ba6 Merge branch 'feature-reactingParcelFoam-dynamicMesh' into 'develop'
INT: reactingParcelFoam: add dynamicMeshMotion capabilities

See merge request Development/openfoam!416
2020-12-18 11:58:19 +00:00
5e539b30a9 INT: reactingParcelFoam: add dynamicMeshMotion capabilities 2020-12-18 11:58:09 +00:00
6ca6b34add CONFIG: update completions 2020-12-18 11:33:46 +01:00
e9dcc59c4d STYLE: trim trailing space 2020-12-18 09:24:01 +01:00
c5dece6a09 STYLE: use IOError to report bad lookup of volumeUpdateMethod
- adjust comments for '-world' option
2020-12-18 09:21:18 +01:00
6068148c22 STYLE: adjust packing of members, header comments 2020-12-18 09:13:34 +01:00
a92cd03a89 GIT: update headers 2020-12-18 08:56:14 +01:00
9ee0023bc0 Merge branch 'feature-MPPIC-dynamicMesh' into 'develop'
ENH: MPPIC dynamic mesh

See merge request Development/openfoam!406
2020-12-17 21:17:59 +00:00
0923c1277c STY: Updating headers 2020-12-17 21:17:03 +00:00
06a0bf1868 TUT: Adding new MPPICDyMFoam and uncoupledKinematicParcelDyMFoam tutorials
STY: Style and header-content changes
2020-12-17 21:17:03 +00:00
6d4e72dc3f ENH: Using basicKinematicCloud for MPPICFoam and MPPICDyMFoam 2020-12-17 21:17:03 +00:00
eb33b7957e BUG: Correction to tgtPointFace srcPointFace member functions 2020-12-17 21:17:02 +00:00
5bc846553c ENH: Updates to MPPIC sub-models. Instantiation for kinematic clouds 2020-12-17 21:17:02 +00:00
9207140e37 ENH: Adding check for wall interaction when particle is stuck on moving
walls

A new user input parameter UrMax is added to the PatchInteractionModel.
In some occasions the partile remains on a patch face due to extremely
low relative U. If this Ur is lower than UrMax the particle is removed
2020-12-17 21:17:02 +00:00
d7b1a666b5 ENH: Adding MPPIC sub-models to Kinematic cloud 2020-12-17 21:17:02 +00:00
f7dc0d8edb ENH: Updating particle member functions
- Dealing with detA < 0 tracking issues
- Modified locate function
2020-12-17 21:17:01 +00:00
8427eccd00 ENH: Triggering oldCellCentres calculation in Clouds 2020-12-17 21:17:01 +00:00
9a39481062 ENH: Adding oldCellCentres field to polyMesh 2020-12-17 21:17:01 +00:00
fbfc09979e CONFIG: bump API to 2012 (pre-release) 2020-12-17 21:32:53 +01:00
a0fe5e4fb2 SUBMODULE: update for runTimePostProcessing 2020-12-17 21:29:56 +01:00
8afed765be ENH: memory management for exprResultGlobals via objectRegistry
- replaces previous code that used an autoPtr to hold a singleton.

  In some circumstances this deletion would conflict with clearing
  the objectRegistry - leading to error messages on exit.

  Now store directly on the registry (similar to a MeshObject)
2020-12-17 20:44:35 +01:00
66865b9fbc BUG: Correcting include path for MPPICFoam 2020-12-17 09:51:11 -08:00
260db42f7f BUG: Correcting DPMIncompressibleTurbulenceModel in DPM solvers 2020-12-17 09:26:56 -08:00
7f17a71f9c ENH: make PDRsetField ground, outer patch names configurable
- previously hard-coded, now adjustable within PDRsetFieldsDict

    // Change some predefined patch names
    patchNames
    {
        ground      ground;
        outer       outer;
    }

ENH: additions to PDRutils, improve comments

- expose enumerated expansion names and gridControl (PDRblock).
  Not commonly needed, but useful to have access when defining
  other grid generators

TUT: update PDRsetFieldsDict and tutorials to use "ground"

- remove tutorial references to unused types and legacy obstacles

- use "ground" for the boundary conditions instead of "seaGround".
  Consistent with PDRblockMesh
2020-12-17 01:23:31 +01:00
05d0a4f1d4 STYLE: add warning if function object subRegion is not found 2020-12-17 00:14:16 +01:00
4bd1bd7522 BUG: Using autoPtr for turbulence in interFoam and interIsoFoam 2020-12-16 15:00:15 -08:00
3e431de285 Merge branch 'feature-Eulerian-recycling-boundary-conditions' into 'develop'
ENH: outletMappedUniformInlet: add optional fraction and offset

See merge request Development/openfoam!399
2020-12-16 18:28:30 +00:00
12efbd8965 TUT: airRecirculationRoom: add new reactingParcelFoam tutorial 2020-12-16 18:28:18 +00:00
5af5222141 ENH: outletMappedUniformInlet: add optional fraction and offset entries
The new functionality optionally allows the patch-averaged
value to be scaled and/or offset by a pair of specified values.

Example of the boundary condition specification:

```
<patchName>
{
    // Mandatory entries (unmodifiable)
    type            outletMappedFilterInlet;
    outletPatch     <outletPatchName>;

    // Optional entries (unmodifiable)
    fraction        0.1;
    offset          10;    // (1 0 0);
    phi             phi;

    // Optional (inherited) entries
    ...
}
```
2020-12-16 18:28:18 +00:00
4a80672afb Merge branch 'feature-varRhoTurbVOF' into 'develop'
Feature var rho turb vof

See merge request Development/openfoam!405
2020-12-16 17:57:46 +00:00
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
dbaed65d75 BUG: redistributePar: failing reconstruct. See #1953.
In reconstruct mode redistributePar will have
- master read undecomposed mesh
- slaves construct dummy mesh (0 faces/points etc.)
  but correct patches and zones
so all processors have two valid meshes. This was
all handled inside fvMeshTools::newMesh and this
was behaving differently.
2020-12-16 17:27:08 +00:00
723edc1c61 ENH: redistributePar: avoid temporary unassigned faces. See #1956. 2020-12-16 17:27:08 +00:00
7456335ba6 Merge branch 'issue-1849-volFieldValue-parallel-IO' into 'develop'
BUG: volFieldValue FO: parallel/empty output (#1853 #1849)

See merge request Development/openfoam!413
2020-12-16 17:09:17 +00:00
0d21f248a9 BUG: volFieldValue FO: parallel/empty output (#1853 #1849)
TUT: volFieldValue FO: adds usage example
TUT: multiply FO: adds usage example
2020-12-16 17:09:06 +00:00
062fad4662 Merge branch 'feature-function1-limit-range' into 'develop'
Feature function1 limit range

See merge request Development/openfoam!414
2020-12-16 15:25:24 +00:00
a4dc2cc94b ENH: Added new LimitRange Function1 wrapper
Function1 wrapper that limits the input range of another Function1

Example usage for limiting a polynomial:

    limitedPolyTest        limitRange;
    limitedPolyTestCoeffs
    {
        min         0.4;
        max         1.4;

        value       polynomial
        (
            (5 1)
            (-2 2)
            (-2 3)
            (1 4)
        );
    }

Here the return value will be:
- poly(0.4) for x <= 0.4;
- poly(1.4) for x >= 1.4; and
- poly(x) for 0.4 < x < 1.4.
2020-12-16 15:24:50 +00:00
9f5b8d0ebb ENH: polynomial - added clone() 2020-12-16 15:24:50 +00:00
dfe98fdf67 ENH: linearInterpolationWeights - protect against and provide early exit if input values are equal 2020-12-16 15:24:49 +00:00
2811c05444 ENH: lazier handling of dynamic libraries
- previously always called dlclose on opened libraries when destroying
  the dlLibraryTable. However, by force closing the libraries the
  situation can arise that the library is missing its own code that it
  needs on unload (#1524). This is also sometimes evident when closing
  VTK libraries for runTimePostProcessing (#354, #1585).

- The new default is to not forcibly dlclose any libraries, unless
  the dlcloseOnTerminate OptimisationSwitch specifies otherwise.

  - The dlLibraryTable::close() method can be used to explicitly close
    all libraries and clear the list.

  - The dlLibraryTable::clear() method now only clears the entries,
    without a dlclose.
2020-12-16 11:25:04 +01:00
dc0372858d ENH: Changing normalization with YMix for the ReactingMultiPhaseParcel
The parcel mass fractions transfer of ReactingMultiPhaseParcel was modified
in order to be consistent between processors.
2020-12-15 14:59:49 -08:00
373d88a4c4 ENH: Function1 - added some missing time conversions 2020-12-15 21:46:57 +00:00
d5260b18d7 ENH: add wmake -show-mpi-compile, -show-mpi-link options
- useful for diagnosing which MPI paths and flags are being used
  when setting up for a new MPI configuration.
2020-12-15 21:45:59 +01:00
c77194e6a1 BUG: incorrect return values for interpolated sampled meshedSurface (#1956)
- only slipped in recently, as part of Development/openfoam!394
2020-12-15 21:45:55 +01:00
b012475c01 ENH: snappyLayerDriver - ensure parallel consistent rebuilding of face centres 2020-12-15 20:38:41 +00:00
05bf4e119a BUG: potential fix for stale fvMesh addressing - see #1956
Failures shown in interFoam cases were found to be a result of stale ldu
addressing in fvMesh.  Potentially delete lduPtr_ alone, but likely safer to
clear all addressing:

    // deleteDemandDrivenData(lduPtr_);
    clearAddressing(true);
2020-12-15 12:06:46 +00:00
19bd7ed21f Merge branch 'feature-Bilger-mixture-fraction-fo' into 'develop'
ENH: BilgerMixtureFraction: New function object

See merge request Development/openfoam!393
2020-12-15 08:55:29 +00:00
e82956a9dc TUT: counterFlowFlame2D: add BilgerMixtureFraction FO 2020-12-15 08:55:13 +00:00
5a8caa35b2 ENH: BilgerMixtureFraction: add new reactionThermo FO
Signed-off-by: Sergio Ferraris <s.ferraris@opencfd.co.uk>
Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-12-15 08:55:13 +00:00
a16c4ae920 ENH: Exposing specieComposition from ReactingMixture
The FO BilgerMixtureFraction needs access to specieComposition which is
stored in ReactingMixture. A virtual mechanism was added to
basicSpecieMixture to access specieComposition form rho and psi
reationThermos.

ptr was changed to autoPtr to avoid memory leaks (Kutalmis Bercin)
2020-12-15 08:55:13 +00:00
9f53fdcc36 DOC: moleFractions: improve header-file doc and style consistency
INT: moleFractions: add phaseName support
2020-12-15 08:55:13 +00:00
bb07945ad2 BUG: Change default behavior for particle vol-mass change
If keys constantVolume and volumeUpdateMethod are not preent
default to constantVolume = false
2020-12-14 13:47:04 -08:00
27ec25dfef STYLE: report address/field size mismatch 2020-12-14 17:30:08 +01:00
a629fb7db2 Merge branch 'feature-function-objects-multiply' into 'develop'
ENH: Function objects - added new 'multiply' function object

See merge request Development/openfoam!410
2020-12-14 16:08:54 +00:00
75769add98 ENH: Function objects - added new 'multiply' function object
Multiplies a given list of (at least two or more) fields and outputs the
result into a new field.

    fieldResult = field1 * field2 * ... * fieldN

Minimal example by using \c system/controlDict.functions:

    multiply1
    {
        // Mandatory entries (unmodifiable)
        type    multiply;
        libs    (fieldFunctionObjects);

        // Mandatory (inherited) entry (runtime modifiable)
        fields  (<field1> <field2> ... <fieldN>);

        ...
    }
2020-12-14 17:03:09 +01:00
b700456ac4 CONFIG: increment to ADIOS-2.6.0, petsc-3.14.2
- the adiosFoam module has been updated to handle restart with
  the newer time structure (directories only, no files)
2020-12-14 15:20:36 +01:00
75f13e1890 ENH: expose fileOperation::sortTimes as public 2020-12-14 14:23:54 +01:00
ea2e24b6c7 ENH: track old output times for lumpedPoint output (#1793)
- now also tracks the previous output time, which aids on restarts
  since it allows the FEA side the possibility of determining
  the effective deltaT between the output of forces
2020-12-14 12:32:08 +01:00
8fa0921556 COMP: resolved some compiler warnings 2020-12-14 10:35:42 +00:00
696704a0dd COMP: solidFoam: extraneous includes. See 1956. 2020-12-14 08:44:45 +00:00
4fdeb3be83 COMP: remove 64-bit label ambiguity
COMP: fix SP/DP inconsistency in fvGeometryScheme

STYLE: rename polyMesh::updateGeom to polyMesh::updateGeomPoints

- avoids compiler complaints and potential masking of
  primitiveMesh::updateGeom / fvMesh::updateGeom

- mark argument as movable, since that is what is happening inside.

GIT: remove merge cruft

TUT: better clean on MPPICInterFoam
2020-12-11 21:37:54 +01:00
b89f389606 CONFIG: support optional config.sh/readline file
- provides a hook for specifying alternative locations
2020-12-11 21:37:42 +01:00
4c501c4567 Merge branch 'feature-PDRblockMesh' into 'develop'
add outer region to PDRblockMesh.

See merge request Development/openfoam!388
2020-12-11 20:24:47 +00:00
cf3d983b80 ENH: add treatment for PDRblockMesh outer region expansions (#1906)
// Treatment of the outer region
   outer
   {
       type        sphere;
       onGround    true;
       expansion   relative;

       ratios      1.1;

       size        3;
       nCells      10;
   }
2020-12-11 20:24:25 +00:00
e2d7ad5c60 GIT: rename directory PDRsetFields -> PDR 2020-12-11 20:24:24 +00:00
649b1b1971 Merge branch 'feature-noise-weighting-and-refactor' into 'develop'
ENH: noise models - added A, B, C, and D weightings to SPL

See merge request Development/openfoam!408
2020-12-11 20:22:07 +00:00
67204543d0 ENH: noise models - added A, B, C, and D weightings to SPL
The SPL can now be weighted according to the new 'SPLweighting' entry
that can be set to:
- none: no weighting
- dBA : dB(A)
- dBB : dB(B)
- dBC : dB(C)
- dBD : dB(D)

This commit also includes code refactoring of the  noiseModel class to
remove the dependency on noiseFFT/declutter.
2020-12-11 20:21:35 +00:00
8534983b0a Merge remote-tracking branch 'origin/master' into develop 2020-12-11 17:42:29 +00:00
cfde0d679a Merge branch 'bug-1949-globalSum-in-derivative-of-merit-function' into 'master'
BUG: globalSum needed in the merit functions' directional derivative (fixes #1949)

Closes #1949

See merge request Development/openfoam!403
2020-12-11 17:39:00 +00:00
7ffa36dfa9 BUG: globalSum needed in the merit functions' directional derivative (fixes #1949)
Does not affect the current functionality of shape optimisation.
2020-12-11 17:38:22 +00:00
5d3f355d9d Merge branch 'bug-1948-wrong-first-merit-function-value' into 'master'
BUG: Wrong First extrapolated value of the merit function (fixes #1948)

Closes #1948

See merge request Development/openfoam!402
2020-12-11 17:37:35 +00:00
2eae536a70 BUG: Wrong First extrapolated value of the merit function (fixes #1948)
Affected only the first optimisation cycle, if line search was enabled

If eta was not set explicitly, it was computed after evaluating the
directional derivative of the merit function, which was computed
wrongly, leading to an erroneous value of the extrapolated merit
function value.
2020-12-11 17:37:18 +00:00
d119b8b8f9 Merge branch 'bug-1947-writing-control-points-in-collatedFormat' into 'master'
BUG: collated format and writing of NURBS3DVolume CPs - see #1947

See merge request Development/openfoam!401
2020-12-11 17:32:51 +00:00
821222834d Merge branch 'feature-adjoint-releaseCandidatev2012' into 'develop'
Adjoint: release candidate for v2012

See merge request Development/openfoam!400
2020-12-11 17:24:04 +00:00
f7e4b374d9 TUT: added a tutorial showcasing the transformBox option
for the definition of the morphing box in volumetric B-Splines.
2020-12-11 17:22:44 +00:00
d0b59a4529 TUT: updated the da entries for the multi-point, turbulent optimisations 2020-12-11 17:22:44 +00:00
73339d4985 STYLE: endl missing in the headerInfo of objectivePartialVolume 2020-12-11 17:22:44 +00:00
6dbaeaba50 ENH: added the capability of constraining the paEqn in adjointSimple 2020-12-11 17:22:44 +00:00
36159cb16d ENH: da is appended by the adjoint solver name
if useSolverNameForFields is set to true. This facilitates continuation.
2020-12-11 17:22:43 +00:00
95748b0183 ENH: deprecation of fvOptionsAdjoint
fvOptionsAdjoint was needlessly duplicating a lot of the functionality
of fvOptions in order to add an interface for computing sensitivity
contributions emerging from fvOptions. To reduce this code duplication:

- fvOptionsAdjoint was removed
- the corresponding sensitivity contributions have moved to fvOptions through
  virtual functions (returning a zero contribution in the base so
  backwards compatibility is retained)
- all sensitivity classes that were using fvOptionsAdjoint have been
  modified appropriately
- all adjoint solvers are now grabbing a reference to an fvOptionList
  from the database instead of constructing an fvOptionsAdjointList

Hence, all fvOptions contributions to the adjoint equations
or the sensitivity derivatives can be given through system/fvOptions,
removing the need for separate sub-dictionaries within optimisationDict.
2020-12-11 17:22:43 +00:00
7d83fb792a ENH: changes in objective::write
- Expanded the write function in the base class so that it can manage
  input coming from the derived ones. This reduces a lot of code
  duplication in the latter but keeps the functionality.
- Added a default width for all entries in the objective files.
- If a normalisation factor or a target is set, they are written on the
  header of the objective file.
- Cosmetic/code consistency changes in various files.
2020-12-11 17:21:38 +00:00
4981061c09 ENH: objectiveManager now writes the weighted objective function
to files, if the corresponding adjoint solver has more than one
objectives.
2020-12-11 17:21:38 +00:00
ae674b2809 ENH: changes in adjointSimple
- Added preLoop, loop and postLoop functions
- Added preIter, mainIter and postIter functions for each SIMPLE
  iteration
- Added addMomentumSource and addPressureSource virtual functions, to
  allow for additions by derived classes
2020-12-11 17:21:38 +00:00
ba300c3c6f ENH: changed the treatment of fvOptions in primal solvers
fvOptions are no longer a member of incompressiblePrimalSolver but are
looked up from the registry in each iteration of each primal solver.
This means that the main system/fvOptions dictionary is read by ALL
instances of the primal solvers and the latter no longer have their
own fvOptions dict in optimisationDict. This is safe since each fvOption
is applied to a specific field and in case of many primal solvers, the
primal fields are named differently for each of them.

In addition, simple is now split in preLoop, loop and postLoop phase.
Furthermore, each SIMPLE iteration is broken down to
a preIter, mainIter and postIter phase, to allow for different behaviour
by derived classes.
2020-12-11 17:21:37 +00:00
0fb515298d ENH: adjointRASModel now returns a reference
to the primal and adjoint solver names
2020-12-11 17:21:37 +00:00
aee0c30a3e ENH: change in the discretization of part of the (E)SI sensitivity terms
Part of the (E)SI shape sensitivities depends of grad(Ua) & nf computed
on the boundary. Up to now, the code was only computing the normal part
of grad(Ua), to avoid the potentially spurious tangential component
which is computed on the cell center and extrapolated to the boundary
faces. However, for some objectives that are strongly related to the
stresses (e.g. moment, stresses), including also the tangential part of
grad(Ua) is necessary for E-SI to replicate the outcome of FI.

Extensive testing on a number of objectives/cases showed
- No regression when including the tangential part
- Improved behaviour in some rare cases (moment, stresses)

Hence, the tangential part is now included by default. The previous code
behaviour can be replicated by setting the useSnGradInTranposeStresses
flag to true.
2020-12-11 17:21:37 +00:00
c2204eaa27 ENH: Minor NURBS3DVolume refactoring
- controlPointsDefinition is now controled by a class with
  runTimeSelection.
- Added a new controlPointsDefinition option that translates, rotates
  and scales a given box. The required entries have the same meaning as
  in the Paraview 'Transform' filter, facilitating the transition between the
  visual placement of control boxes (e.g. in Paraview) and their setup
  in the code.
- Improved performance during the parameterization, sensitivity
  computation and grid displacement phases by re-using already computed
  basis functions.
2020-12-11 17:21:37 +00:00
24d6497209 ENH: add the solver name to the MRF constructor of simple
in case useSolverNameForFields is set to true.
Used for multi-point optmisation runs.
2020-12-11 17:21:37 +00:00
27ea73f905 ENH: added a default word to the IOMRFZoneList constructor
to allow for constructing different MRF zones for multi-point
optimisation runs
2020-12-11 17:21:37 +00:00
5ec8a4d4b1 GIT: removed the deprecated forceTarget objective
since its behaviour can be replicated by the more general framework for
setting objective targets introduced in 6ee7bc66c.
2020-12-11 17:21:37 +00:00
7754e5bd6c Merge branch 'feature-iso_distance-surface' into 'develop'
Feature iso distance surface

See merge request Development/openfoam!407
2020-12-11 16:45:33 +00:00
4c3a95c808 ENH: additional filtering for distance surface (#1950)
- adds topology-based segmentation of the surfaces generated with
  distance surfaces. This can occur when the surface terminates
  close to a thin wall gap in the mesh; resulting in a cuts that
  extend into the next region.

  The cutting algorithm does not normally distinguish between these
  types of "ragged" cuts, and legitimate ones (eg, cutting multiple
  pipes). The additional segmentation controls provide for two common
  scenarios:

  largestRegion (pre-filter):
  - The cut cells are checked for topological connectivity and the
    region with the most number of cut cells is retained.
    This handles the "ragged" edge problem.

  nearestPoints (pre-filter):
  - The cut cells split into regions, the regions closest to the
    user-defined points are retained.
    Uses maxDistance for additional control.

  proximity (post-filter):
  - Checks the resulting faces against the original search surface
    and rejects faces with a distance greater than absProximity.

ENH: restructure distance surface geometric filtering

- prefilter cells, which can be used to adjust the distance
  calculation in the far field to the real distance
  (not the normal distance).

  This can also be used to artificially sharpen the transition
  between near/far regions, if required in the future.
2020-12-11 16:44:54 +00:00
7a99866db0 ENH: unify sampling code for isoSurfaces, support multiple offsets
- support multiple offsets for cutting plane samples
  and multiple iso-values
2020-12-11 16:44:53 +00:00
8fe0d1bacd ENH: improvements for managing iso-surfaces
- generic isoSurfaceBase. Provides simpler cell-cut detection and
  various functions that can be used for iso-surfaces or when
  preparing prefiltered input for iso-surfaces.

- rudimentary runtime selection

ENH: isoSurface Cell/Topo uses the isoSurfaceBase infrastructure

- simpler cell cut detection, common routines
- ensure that tetMatcher is only called once per cell

ENH: use indirect patch during edge erosion

- lower overhead, allows backtracking (future) if needed
2020-12-11 16:44:53 +00:00
4c7f92d29c Merge branch 'tut-alltest-corrections' into 'develop'
TUT: Alltest: Corrections

See merge request Development/openfoam!412
2020-12-11 14:33:26 +00:00
bcae4b7a4f TUT: Alltest: minor corrections (#1956) 2020-12-11 14:33:04 +00:00
e646218af9 BUG: Fixing reading of volumeUpdateMethod
Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-12-11 14:33:04 +00:00
ba4a675cd3 Merge branch 'feature-PatchFunction1-ACMI' into 'develop'
Feature add additional scaling to geometric area overlap calculation inside acmi

See merge request Development/openfoam!374
2020-12-11 10:35:06 +00:00
31ecf0d732 ENH: cyclicACMI: optional scaling with PatchFunction1.
Added 'scale' parameter to cyclicACMI. Scales the amount of 'coupledness' (= mask). Allows opening/closing without mesh motion.
2020-12-11 10:35:06 +00:00
6ac8e06245 Merge branch 'feature-runtime-selection-geometry' into 'develop'
Feature runtime selection geometry

See merge request Development/openfoam!411
2020-12-11 10:31:34 +00:00
46dbfabd9d ENH: primitiveMesh: make geometry calculation runtime selectable
This adds a 'geometry' scheme section to the system/fvSchemes:

geometry
{
    type            highAspectRatio;
}

These 'fvGeometryMethod's are used to calculate
- deltaCoeffs
- nonOrthoCoeffs
etc and can even modify the basic face/cellCentres calculation.
2020-12-11 10:31:34 +00:00
4a166c6f3e Merge branch 'feature-lagrangian-patch-interaction-fields' into 'develop'
ENH: Lagrangian - added new PatchInteractionFields cloud function object

See merge request Development/openfoam!409
2020-12-10 17:26:02 +00:00
9d765adaf4 ENH: Lagrangian - added new PatchInteractionFields cloud function object
Creates volume fields whose boundaries are used to store patch interaction
statistics.

Current field output per patch face:
- \<cloud\>\<model\>:count - cumulative particle hits
- \<cloud\>\<model\>:mass - cumuluative mass of hitting particles

Fields can be reset according to:
- none: fields are not reset
- timeStep: reset at each time step
- writeTime: reset at each write time

Usage

    patchInteractionFields1
    {
        type            patchInteractionFields;
        resetMode       writeTime;
    }
2020-12-10 17:25:40 +00:00
8268d8aaba BUG: redistributePar: avoid par comms. Fixes #1953 2020-12-10 15:43:28 +00:00
b179cd355e STYLE: headers: unused includes. 2020-12-10 15:43:28 +00:00
27a676ca20 Merge branch 'feature-generalizedNewtonian' into 'develop'
Feature generalized newtonian

See merge request Development/openfoam!384
2020-12-10 13:41:46 +00:00
341aea0f5c STY: Removing redundant read function in constructor 2020-12-10 13:40:13 +00:00
b9f7f04bed BUG: Fix to HerschelBulkley model to use nu0 from thermo 2020-12-10 13:40:13 +00:00
a98fbcd493 BUG: Fix to powerLaw model to use nu0 from thermo 2020-12-10 13:40:13 +00:00
54ebe724ea ENH: Derivative of B in thermo.H (dKcdTbyKc) calculated from S and G instead of dGdT
Member function dKcdTbyKc in thermo.H is calculated from S and G at Pstd.
Thus dGdT was removed from the thermos.

- Add optional hRef, eRef and Tref as optional.

- Use new thermo to multiphase solver icoReactingMuliPhaseFoam

- Remove hRefConst and eRefConst thermos.

TUT: Updated tutorials
2020-12-10 13:40:13 +00:00
0dd91a9dc4 ENH: Adding tabulated transport and thermo.
TUT: multiphase/icoReactingMultiPhaseInterFoam/inertMultiphaseMultiComponent
2020-12-10 13:40:12 +00:00
97448c655d ENH: Using icoTabulated EoS and non-Newtonian laminar model 2020-12-10 13:40:12 +00:00
c3c4f30a55 ENH: adding generalizedNewtonian to laminar turbulence model
The generalizedNewtonian viscocity models were ported from
the org version and added to the laminar turbulence framework.

This allows use in compressible and incompressible solvers
through the turbulence dictionary under the laminar sub-dictionary.

The thermal laminar viscosity is taken from the thermo for solvers
that use thermo library or from the transportProperties dictionary
for incompressible solvers.

At the moment the option to include viscocity models through the
transportDict is still available.

The icoTabulated equation of state was ported from the org version.

STYLE: use 'model' instead of 'laminarModel' in tutorials
2020-12-10 13:40:12 +00:00
a89ecdeee0 Merge branch 'feature-vibroAcousticShell' into 'develop'
New vibro-acoustic model suite

See merge request Development/openfoam!404
2020-12-10 13:38:37 +00:00
bc430ccdef ENH: New vibro-acoustic model suite
- New solver: `acousticFoam`
  - New base finite-area region class: `regionFaModel`
  - New base shell model classes:
    - `vibrationShellModel`
    - `thermalShellModel`
  - New shell models:
    - A vibration-shell model: `KirchhoffShell`
    - A thermal-shell model: `thermalShell`
  - New finite-area/finite-volume boundary conditions:
    - `clampedPlate`
    - `timeVaryingFixedValue`
    - `acousticWaveTransmissive`
  - New base classes for `fvOption` of finite-area methods: `faOption`
  - New `faOption`s:
    - `contactHeatFluxSource`
    - `externalFileSource`
    - `externalHeatFluxSource`
    - `jouleHeatingSource`
  - New tutorial: `compressible/acousticFoam/obliqueAirJet`

Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-12-10 13:36:12 +00:00
25246f22a6 Merge branch 'feature-localWorld' into 'develop'
Feature local world

See merge request Development/openfoam!398
2020-12-09 15:20:30 +00:00
348c2a87ad ENH: Adding dynamic mesh to solidFoam and tutorial 2020-12-09 15:17:45 +00:00
df777ce3c6 ENH: waterCooler: new tutorial. 2020-12-09 15:17:45 +00:00
b017ef47bb ENH: Added new multiWorld test case 2020-12-09 15:17:45 +00:00
faba8ee2a1 ENH: Added new solidFoam solver 2020-12-09 15:17:45 +00:00
89f2cda3ab ENH: mpi: use per-application communicator. 2020-12-09 15:17:44 +00:00
627d79dba6 ENH: reduce use of readdir on individual processors (#1946)
- implicitly enabled when timeStampMaster (default) is used
  for the fileModificationChecking

- When running with non-distributed roots (eg, NFS-share) read for
  processor directories on master only and send to sub-processes
  instead individual reads.

- If disabled (old default, or when running with distributed roots),
  uses the regular fileHandler readDir, which may perform readDir
  on each processor. Potentially slow startup times on large systems.

Improvements based on analysis from T.Aoyagi(RIST), A.Azami(RIST)
2020-12-09 14:43:27 +01:00
c51bfdcd05 Merge branch 'feature-buoyancy-fvoption' into 'develop'
ENH: buoyantTurbSource: new fvOption

See merge request Development/openfoam!397
2020-12-08 16:54:50 +00:00
3e4341ad02 ENH: buoyancyTurbSource: add a new fvOption
Applies sources on turbulent kinetic energy (i.e. `k`)
    and either turbulent kinetic energy dissipation rate (i.e. `epsilon`)
    or specific dissipation rate (i.e. `omega`) to incorporate effects
    of buoyancy on turbulence in incompressible and compressible flows.

    See buoyancyTurbSource.H for details.
2020-12-08 16:49:17 +00:00
5de23079ea DOC: fvOptions: improve header documentation
STYLE: use auto/tmp wherever possible
  ENH: make destructor/deleted constructors consistent with FOs
2020-12-08 16:49:17 +00:00
8ad61f8e9d ENH: optional innerRadius for searchable disk
- can be used directly, or in special cases like a searchable plane
  with a gap of things in the centre that are not to be sampled.
2020-12-08 15:32:50 +01:00
56b5234fbc ENH: store concrete sampled isoSurface faces/points as member data
- was previously via inheritance, but using member data instead
  supports a more flexible internal switching of the storage. It also
  ensures that data access remains safe, even in the absence of
  an isoSurface.
2020-12-08 13:31:23 +01:00
ccde68d410 ENH: cellZones support for isoSurface cell/topo sampling variants (#1678)
- better alignment of sampling Cell/Point/Topo inputs

- make exposedPatchName optional for isoSurface, cuttingPlane. This
  was a holdover requirement from an older version of fvMeshSubset
2020-12-08 13:31:23 +01:00
9da5215786 ENH: add sampledSurface::sampleOnPoints
- loop for interpolating volume elements to face points,
  which removes duplicate code in several other places
2020-12-08 13:31:22 +01:00
2f6082712e ENH: modernize some code constructs in isoSurface
- add debug field to isoSurfaceTopo
- don't need dynamic field for new points

- reduce code in sampledIsoSurfaceCell
2020-12-08 13:31:22 +01:00
811a83599e CONFIG: change default distanceSurface algorithm from 'cell' to 'topo'
- yields cleaner surfaces with few cuts.

  Can use isoMethod keyword to select cell/point/topo if they prove
  better for any particular case.

CONFIG: change default cuttingPlane algorithm from 'cell' to 'topo'
2020-12-08 13:31:22 +01:00
b1a27d3d00 ENH: rename 'classic' Foam::isoSurface as Foam::isoSurfacePoint
- better distinction between types of algorithms.
  Easier for future deprecation/replacement.
2020-12-08 13:31:22 +01:00
be783632f2 ENH: isoSurfaceParams
- bundles selection and control parameters used when creating
  iso-surfaces. This simplifies selection and specification

- drop old compatibility handling of "cell" as a bool

- harmonize filter/regularisation flags for iso-surface

- for dictionary input, accept "isoMethod" and "isoAlgorithm" as being
  synonymous. Using "isoMethod" is less subject to typing errors.
2020-12-08 13:31:22 +01:00
61dd6aa701 ENH: code consistency in sampling
TUT: dictionary form of surfaces instead of list
2020-12-08 13:18:38 +01:00
4421021e99 ENH: support use of bitSet for regionSplit 2020-12-08 13:18:38 +01:00
0b68f14f7d ENH: more explicit about handling empty matchers for index lookup
- for boundary meshes, zones etc. The behaviour with an empty matcher
  was either not properly documented, and looped through all
  names just to establish there was no match.

STYLE: removed redundant typedefs for point fields
2020-12-08 13:18:34 +01:00
df74e8448c ENH: robuster fileOperations splitProcessorPath
- robuster matching behaviour when encountering paths that themselves
  contain the word "processor" in them. For example,

    "/path/processor0generation2/case1/processor10/system"
    will now correctly match on processor10 instead of failing.

- use procRangeType for encapsulating the processor ranges

- provision for information of distributed vs non-distributed roots.
  The information is currently available from the initial setup, but
  can useful to access directly within fileOperation.

STYLE: modernize list iteration
2020-12-08 11:58:28 +01:00
a939042e1b ENH: add bitSet::null() and clarify some documentation
- the NullObject singleton can also be cast to a bitSet
  (sufficient size and bit-pattern). Useful for places that
  need to hold a reference on construction
2020-12-08 11:58:28 +01:00
08efeb1a03 ENH: define UPstream rangeType
- UPstream::rangeType as typedef for IntRange<int> for better use
  semantics
2020-12-08 11:58:27 +01:00
e697ac277f CONFIG: respect WM_QUIET=false as a logic value in wmake
- Makefile only checks set/unset, so handle 'false' within wmake
  itself
2020-12-08 11:58:27 +01:00
b966b7cd4b ENH: static test methods for matching simple cell shapes
- (tet, pyr, hex) can be identified from their number of faces
  and vertices. For these common shapes can use static `test()`
  method instead of the virtual isA() method.

  This is much cheaper for calling on an individual basis since
  it avoids the overhead of constructing an object.

ENH: tetCell edge/reverseEdge (already had tetEdge)
2020-12-08 11:58:27 +01:00
b7c8a45de2 STYLE: bracket instead of braces on List constructors
- avoid potential future mistakes if someone adds a sizing dimension
  and finds they have inadvertently called construct labelList with
  `{std::initializer_list<label>}` instead of `label`
2020-12-08 11:58:27 +01:00
7b5c6868dd BOT: Update contributors file 2020-12-08 11:58:27 +01:00
cb924ec3d2 Merge branch 'issue-1900-atmwallfunction-double-value-entry' into 'develop'
BUG:  atm wall functions: fix double "value" entry issue

See merge request Development/openfoam!395
2020-12-08 09:36:13 +00:00
1bc2ffad99 BUG: atm wall functions: fix double "value" entry issue (#1900)
STYLE: atm wall functions: use auto and bool types wherever possible
  TUT: atmosphericModels: changes for style consistency
2020-12-08 09:33:44 +00:00
3b949b66ff BUG: collated format and writing of NURBS3DVolume CPs - see #1947
The if(Pstream::master()) clause in NURBS3DVolume::writeCpsInDict() was
causing the fileName of the regIOobject not to be allocated in all
processors, giving problems when masterUncollatedFileOperation::masterOp
was called by collatedFileOperation::writeObject for the mkDirOp.
2020-12-07 16:41:26 +02:00
14e86437ae Merge branch 'feature-recycle-particles' into 'develop'
Feature recycle particles

See merge request Development/openfoam!396
2020-12-07 09:37:32 +00:00
74ada2aa7f TUT: New recycleParticles tutorial case
Shows an example of the new recyclePatchInteraction model
- particles that escape from the outlet are recycled back into the
  domain via the second inlet

Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-12-04 13:40:28 +00:00
5a71667f45 ENH: Lagrangian - new parcel recycle patch interaction model
Parcels that hit an 'outflow' patch are recycled to an 'inflow' patch, with
optional:
- recycle fraction < 1

Example usage:

    RecycleInteractionCoeffs
    {
        recyclePatches
        (
            (outlet1 inlet1)
            (outlet2 inlet2)
        );

        recycleFraction     0.8; // [0-1]
    }

Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-12-04 13:40:28 +00:00
b25c4611cb ENH: Cloud patch interaction model updates
- MultiInteraction: updated to call info() function of child models
- PatchInteractionModel: added postEvolve hook
- KinematicCloud: call patchInteraction() postEvolve hook
2020-12-04 13:40:28 +00:00
7d897ee7a3 Merge branch 'issue-1871-refPtr-adjointTurbulence' into 'develop'
Issue 1871 - simplifies adjoint turbulence code by using refPtr instead of combined autoPtr/tmp

See merge request Development/openfoam!385
2020-12-04 07:33:40 +00:00
fcf3f8ec17 ENH: replace autoPtr/tmp combination with refPtr (issue #1871)
- reduces some code complexity.
2020-12-03 19:17:59 +00:00
5ad2fe621a Merge branch 'updated-surface-handling' into 'develop'
Updated surface handling

See merge request Development/openfoam!394
2020-11-30 17:13:39 +00:00
029b1373a3 DOC: document writeFile updateHeader flag (fixes #1942) 2020-11-30 13:59:10 +01:00
ab692caf7c ENH: support multiple weights on some field function objects (#1930)
- weight fields are combined by multiplication

  - volFieldValue:
    * 0-N scalar fields

  - surfaceFieldValue:
    * 0-N scalar fields
    * 0-1 vector fields

  In some cases this can be used to avoid creating additional
  fields.

      weightFields  (rho U);
  vs.
      derivedFields (rhoU);
      weightField   rhoU;
2020-11-30 13:59:10 +01:00
f8d08a805b ENH: additional handling for out-of-range sampling (#1891)
- when sampling onto a meshed surface, the sampling surface may be
  outside of the mesh region, or simply too far away to be considered
  reasonable.

  Can now specify a max search distance and default values for samples
  that are too distant.
  If a default value is not specified, uses Type(Zero).

  Eg,

      maxDistance     0.005;
      defaultValue
      {
          "p.*"   1e5;
          T       273.15;
          U       (-100 -100 -100);
      }
2020-11-30 13:59:10 +01:00
a947e9ddcf ENH: new sampled faceZones (#1874) 2020-11-30 13:59:10 +01:00
90fe49e8e5 ENH: adjust sampledPatch (#1874) for similarity with surfaceFieldValue 2020-11-30 13:59:10 +01:00
6cf8151817 ENH: support surfaceFieldValue on multiple faceZones or patches (#1874)
- additional "names" entry to specify a word/regex list of selections
  For example,
  {
      type    patch;
      name    inlets;
      names   ("inlet_[0-9].*" inlet);
  }

- if "names" exists AND contains a literal (non-regex) that can be used
  as a suitable value for "name", the "name" entry becomes optional.
  For example,
  {
      type    patch;
      names   ("inlet_[0-9].*" inlet);

      // inferred name = inlet
  }

- reduce some overhead in surfaceFieldValue

TUT: surfaceFieldValue on patches : reactingParcelFoam/verticalChannel
2020-11-30 13:59:10 +01:00
f82af7cb2a ENH: initial support for abaqus surface sampled output (#1600)
- supports geometry and field-specific scaling, separate geometry and
  fields. Beta-feature for suppressing geometry output entirely.
2020-11-30 13:59:10 +01:00
1d398d8cae ENH: handle abaqus SURFACE input (#1600)
- read surfaces which are defined in terms of solid element sides. Eg,

```
  *ELEMENT, TYPE=C3D4, ELSET=...
  1, ...
  2, ...

  *SURFACE, NAME=Things, TYPE=ELEMENT
  1, S1
  2, S1
```

  The element and side number are encoded as a synthetic face id
  according to

      -(10 * elemId + sideNum)

  but the underlying solid geometry is discarded, since there is no
  reasonable way to pass it through the surface sampling mechanism.
2020-11-30 13:59:10 +01:00
986199f897 ENH: align bitSet and FixedList methods names
- bitSet and PackedList fill() as per boost dynamic_bitset.
  Silently deprecate assign(val), which is potentially confusing
  with other forms of assign().

- FixedList fill() as per std::array.
  Add missing assignment from Foam::zero

- minor code simplication in bitSet and PackedList

STYLE: fix typo in comment, qualify Foam::zero
2020-11-30 13:59:07 +01:00
66c8607d5f CONFIG: trap -with-bear, but continue argument processing
- makes it easier to combine with -log options etc.
2020-11-30 10:21:57 +01:00
fc6a5a6dad GIT: correct submodule indices 2020-11-28 21:17:35 +01:00
7830cc503e BUG: Fix sign in Lee model. Fixes #1934. 2020-11-27 19:46:08 -08:00
c879c24412 ENH: redistributePar: suppress warning. Fixes #1937. 2020-11-26 13:46:50 +00:00
9c86b5d722 ENH: robustness improvements for wmakeFunctions
- relocated module-prefix handling to wmakeFunctions
2020-11-26 12:54:46 +01:00
a50047bbcc ENH: add hook for bear frontend to create json output (#1936)
Example usage,

   wmake -with-bear src/OpenFOAM
   src/Allwmake -with-bear -s -j

- bin/tools/vscode-settings

  Emit some json content suitable for setting up Visual Studio Code
  for use with OpenFOAM.

  For example,
      bin/tools/vscode-settings > .vscode/settings.json

Ideas from Volker Weissman
2020-11-26 12:54:46 +01:00
fb7afd5f96 TUT: fix missing line ending and wrong blockMeshDict vertex location 2020-11-26 02:15:20 +01:00
024d22cb64 BUG: missing nullptr check in Function1/PatchFunction1 fallback logic 2020-11-26 01:53:15 +01:00
b4eb214d56 BUG: transformPoints flagged zero or negative scaling as an error
- additional check was introduced by 51b2490258, but scaling with
  zero is useful for flattening a mesh
2020-11-26 01:04:55 +01:00
9fe09ad21d ENH: installation helpers
----
install-dirs: a general directory installer

  Copy installs non-binary (platform) directories.
  Eg,

      install-dirs -prefix=... -devel
      install-dirs -prefix=... -default -no-app

----
install-platform: a platform (binary) installer

  This is primarily driven by the need to install into system mpi
  directories. The problem noted in issue #1893 is caused by the
  rpm-mpi-hooks (fedora and redhat-8).

  For the additional mpi library qualifier (openmpi-x86_64) to be
  added to the requirements, the mpi-specific libraries (eg,
  libPstream.so) need to be installed in the mpi system directory
  (eg, /usr/lib64/openmpi).

  However, then need symlinks from the system locations back to our
  local directories to ensure that the libraries are correctly found
  via our LD_LIBRARY_PATH and we don't get dummy libraries.

----
update-mpi-links: a post-install update hook

  Expected paths are registered as persistent information into the
  hook during packaging. Triggering the hook after installation
  completes the creation of the symlinks.

Normal usage,
```
prefix="/tmp/local-install/openfoam"

bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -prefix="$prefix"
```
Installs
 - /tmp/local-install/openfoam/META-INFO
 - /tmp/local-install/openfoam/bin
 - /tmp/local-install/openfoam/etc
 - /tmp/local-install/openfoam/platforms/linux64GccDPInt32Opt/bin
 - /tmp/local-install/openfoam/platforms/linux64GccDPInt32Opt/lib

Can also place architecture-dependent bits elsewhere,
```
prefix="/tmp/local-install/openfoam"
multi_arch="$(dpkg-architecture -qDEB_TARGET_MULTIARCH)"

bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -exec-prefix="$prefix/$multi_arch"
```
Installs
 - /tmp/local-install/openfoam/META-INFO
 - /tmp/local-install/openfoam/bin
 - /tmp/local-install/openfoam/etc
 - /tmp/local-install/openfoam/x86_64-linux-gnu/bin
 - /tmp/local-install/openfoam/x86_64-linux-gnu/lib

Can use it to flatten out platforms entirely,
```
prefix="/tmp/local-install/openfoam"
bin/tools/install-dirs -prefix="$prefix" -common
bin/tools/install-platform -exec-prefix="$prefix"
```
Installs
 - /tmp/local-install/openfoam/META-INFO
 - /tmp/local-install/openfoam/bin
 - /tmp/local-install/openfoam/etc
 - /tmp/local-install/openfoam/lib
2020-11-25 21:31:22 +01:00
c2bf9e1cc8 CONFIG: bump API to 2011
- mostly to reflect changes in config prefs and output methods
2020-11-25 21:31:02 +01:00
52c6642a4c Merge remote-tracking branch 'origin/master' into develop 2020-11-25 21:30:49 +01:00
1fa4221bc8 COMP: fix label ambiguity 2020-11-25 19:53:03 +01:00
501cd35351 ENH: consistent naming for ZoneMesh lookup method
- findZone(), cfindZone() to return pointer to existing or nullptr if
  not found. This fits with methods such as findObject() etc for other
  classes and can simplify code without checks for '-1' as not found.

- use simpler constructors for empty cell/face/point zones
2020-11-25 19:53:03 +01:00
be7a3f21be ENH: add BitOps::set(), unset() functions for boolList, labelHashSet 2020-11-25 19:53:03 +01:00
0de32a6e6f ENH: improve flexiblity for flat output of items (#1929)
- change to a templated implementation instead of relying on
  the container's writeList() method.

  This inlines the generation while also adding the flexibility to
  define different delimiters (at compile time) without the
  performance penalty of passing run-time parameters.
2020-11-25 19:53:03 +01:00
d2f1690536 ENH: align Enum methods with HashTable
- deprecate get(key, deflt) in favour of lookup(key, deflt).
  Method name compatibility with HashTable.

- deprecate operator().
  The meaning is too opaque and equally served by other means:

  - use get(key) instead of operator()(key).
    Const access whereas HashTable::operator()(key)
    creates missing entry.

  - lookup(key, deflt) - instead of operator()(key, deflt).
    Const access whereas HashTable::operator()(key, deflt)
    creates a missing entry.

- make Enum iterable to allow participation in range-for etc.
2020-11-25 19:53:02 +01:00
9122713b37 STYLE: mark deprecated findIndices methods with warnings
- were deprecated Aug-2018, but not marked as such
2020-11-25 19:53:02 +01:00
7349b97ecc STYLE: use labelRange for identity 2020-11-25 19:53:02 +01:00
ae49b51182 ENH: improve offsets handling in extrudeToRegionMesh (#1933)
- non-uniform offsets are generated due to truncation errors,
  which can lead to problems later on (e.g. redistributePar).

  Detect if the offsets are close to being uniform.
2020-11-25 19:53:02 +01:00
89ea011585 ENH: snappyHexMesh: gapLevel. See #1463.
Adds distance-to-surface as a pre-selection
to detect cells-in-gaps. Before it could only
use inside or outside but not distance.
2020-11-25 16:10:02 +00:00
ac98e498fe BUG: meshToMesh - corrected mapping of internal field for tgt->src mapping. Fixes #1935 2020-11-24 12:01:15 +00:00
9c26b5ce9f BUG: subsetMesh: map instead of truncate. See #1558.
This also is to do with redistributePar:
this uses subsetMesh to generate parts to
send to different processors.
2) related to 1558: make sure not to choose 'mapped'
patches to move the processor patches into so
we can use the mapper cloning and correctly
size additional data (e.g. offsets). This should
be generalised to hold for any patch type
holding local data ...
2020-11-23 19:58:31 +00:00
f9033cbf92 BUG: wall distance: Fixes #1932.
Potential problem with multiple faces. Rewritten to
use DynamicList.
2020-11-23 13:08:17 +00:00
eaf6440a0a COMP: Allwmake: delay building finiteArea
For convenience - build finiteVolume first
2020-11-23 13:08:17 +00:00
88afcae8e8 Merge branch 'feature-Function1' into 'develop'
corrections and improvements for Function1

See merge request Development/openfoam!391
2020-11-20 15:18:25 +00:00
4b964f676e STYLE: fix doxygen comments 2020-11-19 16:57:45 +01:00
8d2d894ae0 ENH: support frequency or period for Sine/Square Function1 (#1917)
- For slow oscillations it can be more intuitive to specify the
  period.

ENH: separate mark/space for Square

- makes it easier to tailor the desired intervals.

BUG: incorrect square wave fraction with negative phase shifts

ENH: additional cosine Function1

STYLE: avoid code duplication by inheriting Cosine/Square from Sine.
2020-11-19 16:57:45 +01:00
6e3bc1f7d0 STYLE: can add compile-time deprecated message for autoPtr::set()
- deprecated Feb-2018, but not marked as such.

  The set() method originally enforce an additional run-time check
  (Fatal if pointer was already set), but this was rarely used.
  In fact, the set() method was invariably used in constructors
  where the pointer by definition was unset.

  Can now mark as deprecated to catch the last of these.
  We prefer reset() for similarity with std::unique_ptr

  Eg,
  FOAM_EXTRA_CXXFLAGS="-DFoam_autoPtr_deprecate_setMethod"  wmake
2020-11-19 16:57:45 +01:00
2f2dcdcf6f ENH: Function1 and PatchFunction1 improvements (#1917)
- easier support for non-mandatory functions.

  In some boundary conditions it can be desirable to support
  additional functions, but not necessarily require them. Make this
  easier to support with a Function1, PatchFunction1 NewIfPresent()
  selector.

- support for compatibility lookups

- harmonize branching logic and error handling between Function1 and
  PatchFunction1.

ENH: refactor a base class for Function1, PatchFunction1

- includes base characteristics, patch or scalar information

ENH: additional creation macros

- makeConcreteFunction1, makeConcretePatchFunction1Type for adding a
  non-templated function into the correct templated selection table.
  makeScalarPatchFunction1 for similarity with makeScalarFunction1
2020-11-19 16:57:45 +01:00
07bbae0c55 STYLE: use brace constructors for Foam::zero and Foam::one
- makes it clearer that these are constructors and not function calls
2020-11-19 16:57:45 +01:00
98d05fa80a STYLE: prefix zero/one with Foam:: qualifier
ENH: support construction of zero-sized IndirectList

- useful when addressing is to be generated in-place after construction.
  Eg,

      indirectPrimitivePatch myPatches
      (
          IndirectList<face>(mesh.faces(), Zero),
          mesh.points()
      );
      labelList& patchFaces = myPatches.addressing();

      patchFaces.resize(...);
      // populate patchFaces

STYLE: add noexcept for zero/one fields and remove old dependency files

COMP: correct typedefs for geometricOneField, geometricZeroField
2020-11-19 16:55:29 +01:00
f126e29121 ENH: fanPressureFvPatchScalarField - adjust compatibility handling
COMP: add missing clone() for fanCurve member

STYLE: reduce padding in data members
2020-11-19 12:36:57 +01:00
d1453b037a STYLE: duplicate include dir 2020-11-18 22:41:14 +01:00
da7165077c BUG: typo in solidProperties prevents re-reading of "Hf" (fixes #1927) 2020-11-18 19:38:55 +01:00
6dd2cc808e CONFIG: provisional cuda rule. Update naming for CGAL rules 2020-11-17 21:29:07 +01:00
9fd514bbe6 ENH: support OFstream "/dev/null" equivalent directly
- uses ocountstream for the output, which swallows all output.
  Improves portability

ENH: improved efficiency in countstreambuf

- xsputn() instead of overflow
- more consistent seek* methods
2020-11-17 14:43:00 +01:00
345a42f2d8 ENH: improve overhead in planeToFaceZone
- use bitSet instead of boolList/HashSet. Simplify looping
2020-11-17 12:36:45 +01:00
24c9761429 COMP: silence warnings, fix transcription error for planeToFaceZone
ENH: add construct from components

STYLE: adjust action variable name for consistency
2020-11-17 12:36:45 +01:00
8969110f2a ENH: distinguish between face zone topoSetSource (#1060)
- add intermediate class topoSetFaceZoneSource
  and corresponding New() factories
2020-11-17 12:33:13 +01:00
54139592b9 ENH: add bitSet found() method - method name compatibility with HashSet 2020-11-17 10:50:42 +01:00
146a1d1b67 ENH: snappyHexMesh: par extrusion. Fixes #1923 2020-11-16 11:22:56 +00:00
fc541cee40 BUG: crash during gap refinement (fixes #1919)
- fixed indexing error (crashes under windows).
  No crash but still incorrect on other systems
2020-11-13 11:00:13 +01:00
79a4dc5153 Merge branch 'feature-particle-histogram' into 'develop'
ENH: PatchParticleHistogram: add a new cloud FO

See merge request Development/openfoam!386
2020-11-13 09:23:24 +00:00
2a64d98d02 ENH: PatchParticleHistogram: add a new cloud FO
Computes a histogram for the distribution of particle diameters
  and corresponding number of particles hitting on a given list of patches.

  A minimal example by using `constant/reactingCloud1Properties.cloudFunctions`:

  ```
  patchParticleHistogram1
  {
      // Mandatory entries (unmodifiable)
      type             patchParticleHistogram;
      patches          (<patch1> <patch2> ... <patchN>);
      nBins            10;
      min              0.1;
      max              10.0;
      maxStoredParcels 20;
  }
  ```
2020-11-13 09:22:46 +00:00
48592e8152 Merge branch 'code-review-nov20.kbc' into 'develop'
Miscellaneous code changes - Nov 20

See merge request Development/openfoam!387
2020-11-13 09:22:36 +00:00
a1c25e6201 ENH: heatTransferCoeff: add optional Nusselt number functionality
DOC: heatTransferCoeff models: complete remaining header docs
  STYLE: heatTransferCoeff models: use auto specifier when appropriate

  Optionally, the Nusselt number (i.e. the ratio of convective to conductive
  heat transfer at a boundary in a fluid) can be output:

  ```math
      Nu = \frac{h L}{\kappa}
  ```

  where
  ```
    Nu | Nusselt number
    h  | Convective heat transfer coefficient of the flow
    L  | Characteristic length that defines the scale of the physical system
    \kappa | Thermal conductivity of the fluid
  ```
2020-11-13 09:18:44 +00:00
bbeda07862 BUG: polynomialEqns: fix discriminant limit
It was observed in a MPPICDyMFoam simulation involving a single particle
in a moving mesh that the barocentric trajectory of the particle follows
an unexpected path at some arbitrary instant in time.

The issue was tracked to "hitEqn()" where cubicEqn/quadraticEqn computes
one of the roots wrongly due to the discriminant limit we set, e.g. for:

    0x^3 + 1.4334549e-33 x^2 - 9.0869006e-10 x + 0.0027666538

Although the discriminant limit was carefully selected to avoid various
problems at the time, the new change is required more due to its exposition
to a wider spectrum of applications.
2020-11-13 09:18:44 +00:00
b42db6cee5 BUG: reconstructPar: prevent crashes when operating on processor cases (#1143)
From OpenFOAM Foundation e4d89daf5d

The main issue here was that reconstructPar is serial but coupled() in
cyclicAMIFvPatch.C could return true if both sides of the patch was present
(this->size() && neighbFvPatch().size()). However, this would result in an
evaluate call in cyclicAMIFvPatchField. This would only work if both sides
were completely contained on the same processor. The change in logic prevents
coupled() from returning true when called in serial for a decomposed case.

Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-11-13 09:18:44 +00:00
d392bf9841 DOC: actuationDiskSource: fix content (#1828)
ENH: actuationDiskSource: change two FatalError to FatalIOError
2020-11-13 09:18:43 +00:00
83b432c9d2 TUT: cavity: add Allrun-parallel
The change helps to carry out and monitor
  parallelisation tests for FOs and topoSets.
2020-11-13 09:18:43 +00:00
da65e02707 INT: planeToFaceZone: integrate a new topoSet from OpenFOAM.org 2020-11-13 09:18:43 +00:00
cf6d5b844f Merge branch 'feature-rationalize-mpi-configs' into 'develop'
Feature rationalize mpi configs

See merge request Development/openfoam!389
2020-11-12 17:25:07 +00:00
c91fc6f41c CONFIG: rationalize mpi config tuning (#1910)
- prefix FOAM_MPI and library directories with 'sys-' for system
  versions for uniform identication.

  WM_MPLIB      | libdir (FOAM_MPI)  | old naming |
  SYSTEMMPI     | sys-mpi            | mpi        |
  SYSTEMOPENMPI | sys-openmpi        | openmpi-system |

- prefix preferences with 'prefs.' to make them more easily
  identifiable, and update bin/tools/create-mpi-config accordingly

      Old name: config.{csh,sh}/openmpi
      New name: config.{csh,sh}/prefs.openmpi

- additional mpi preferences now available:
    * prefs.intelmpi
    * prefs.mpich
    ...

CONFIG: added hook for EASYBUILDMPI (eb-mpi), somewhat like USERMPI

- EasyBuild uses mpicc when compiling, so no explicit wmake rules are
  used

ENH: support different major versions for system openmpi

- for example, with

     WM_MPLIB=SYSTEMOPENMPI2

  defines FOAM_MPI=sys-openmpi2 and thus creates lib/sys-openmpi2

ENH: centralize handling of mpi as 'mpi-rules'

    Before:
        sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
        sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)

        ifeq (,$(FOAM_MPI_LIBBIN))
            FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI)
        endif

    After:
        include $(GENERAL_RULES)/mpi-rules

- also allows variants such as SYSTEMOPENMPI2 to be handled separately
2020-11-11 18:36:01 +01:00
26ec9b5a17 CONFIG: rationalize compiler tuning
- support prefs.compiler with better possibilities to provide
  overload values

STYLE: reduce code for WM_ARCH_OPTION (seldom-used)
2020-11-11 17:58:47 +01:00
67b3c01e13 ENH: generalize argList help output 2020-11-11 16:59:01 +01:00
ef2ea9629c STYLE: line breaks and spelling 2020-11-11 10:02:17 +01:00
30ea7d6134 BUG: Make volUpdateType default to constRho particle. Fixes #1916 2020-11-10 09:17:21 -08:00
fbcf7111be BUG: Taking out contErr contribution to TEq for divUp. Fixes #1813.
contErr is based on rhoPhi not on phi. The term contErr/rho*p in TEq
makes a large correction which occasionally makes T unbounded
2020-11-10 08:52:31 -08:00
4cf44850a7 CONFIG: detect newer adios library name (fixes #1911)
ENH: provide fallback prefix for cmake detection

STYLE: simplify some shell syntax, avoid uname call in sysFunctions

STYLE: report FOAM_MPI during mpiLib builds
2020-11-09 15:43:52 +01:00
f7c8e39804 ENH: update lemon version (#1768)
- upstream fixes: minor compiler warnings, style changes
2020-11-07 18:04:55 +01:00
5e660c36e9 CONFIG: ptscotch header not found on RedHat/Fedora (fixes #1904)
- no limit to the number of ways of filing ptscotch libraries.
  RedHat/Fedora/CentOS should look for these directories:

      ptscotch include=/usr/include/openmpi-x86_64
      ptscotch library=/usr/lib64/openmpi/lib

  when MPI_ARCH_PATH=/usr/lib64/openmpi
  and mpicc --showme:compile yields -I/usr/include/openmpi-x86_64
2020-11-04 15:22:44 +01:00
1d544540d9 ENH: handle wmake -debug option via FOAM_EXTRA_CXX_FLAGS
- ensures that subsequent Allwmake scripts know about it.

ENH: add bin/tools/query-detect wrapper for wmake have_* scripts

CONFIG: use project/ThirdParty without additional sanity checks

- no need to test for Allwmake or platforms/ if ThirdParty is located
  within the project directory itself.

COMP: add simple mpi test to 00-dummy

- for testing library linkage, etc.
2020-11-04 15:17:28 +01:00
83fb48678d COMP: adjust build order
- blockMesh <- extrudeModel <- dynamicMesh

COMP: bad constructor in searchableSphere

- used brace initializer instead of bracket initializer, which
  triggered component-wise construction instead of copy/move
  construction (gcc 4.8)

STYLE: use uint8_t instead of relying on definition of 'direction'
2020-11-04 15:15:36 +01:00
aea876885f ENH: support surfaceFieldValue faceZone on internal volume (#1884)
- uses averaged value instead of emitting a fatal error
2020-10-29 11:32:50 +01:00
bed1305d96 BUG: extraneous brackets after Fluent cell types (fixes #1872)
ENH: limit output to 25 cell types per line for readability

- makes it easier to trace potential format errors etc

STYLE: downgrade warning about polyhedrals to a simple info message

- can assume that polyhedral support is widespread enough to not
  warrant a warning.
2020-10-29 11:21:39 +01:00
3b7100a9a1 BUG: PDRsetFields fails with non-orthogonal outer region (fixes #1907)
- first sort the cells into their ijk bins, and restrict testing for
  face orientation to those faces with an owner or neighbour that has
  an ijk bin.

ENH: ensure polyMesh from PDRblockMesh is marked as AUTO_WRITE

- the particular polyMesh constructor inherits the writeOpt, which
  makes is dependent on the caller and thus somewhat fragile for the
  top level caller.
2020-10-28 20:56:32 +01:00
043419f30a TUT: add examples of general spheroid (#1901)
- for blockMesh meshing and as snappyHexMesh geometry
  (adjust the igloo aspect ratio)
2020-10-28 16:04:12 +01:00
e9d130f022 ENH: support general searchable spheroid (issue #1901)
- a sphere/spheroid can be specified as a single radius or three radii.
  If all three values happen to be identical, they are collapsed to a
  single value. Examples,

      radius 2;
      radius (2 2 2);
      radius (2 3 4);
      radius (2 2 4);

  The search for nearest point on an ellipse or ellipsoid follows the
  description given by Geometric Tools (David Eberly), which also
  include some pseudo code. The content is CC-BY 4.0

  In the search algorithm, symmetry is exploited and the searching is
  confined to the first (+x,+y,+z) octant, and the radii are ordered
  from largest to smallest.

  Searching is optimized for sphere, prolate and oblate spheroids.
2020-10-28 16:04:12 +01:00
4258f8059f ENH: adjustments to searchable surfaces
- code reduction, documentation, code stubs for spheroid (#1901)

- make searchableSurfaceCollection available as 'collection'
  for consistency with other objects
2020-10-28 16:04:12 +01:00
f999013f41 ENH: use static to define default blockMesh verbosity
- make handling of verbosity more consistent.

  Make all setter return the old value, remove (unused) default
  parameter as being counter-intuitive.  This makes it easier to
  restore the original values.

  For example,

     const bool oldVerbose = sampler.verbose(false);
     ...
     sampler.verbose(oldVerbose);
2020-10-28 16:04:12 +01:00
f959c8eb36 ENH: generate local orientation vectors for blockMesh VTK output (#1903)
- can help when designing/debugging blockMesh layouts

- propagate low-level cellModel methods face() and edge() to cellShape

STYLE: relocate blockMesh OBJ output to application only

- remove blockTopology files in cleanCase function

- improve code consistency in top-level blockMesh, PDRblockMesh
  generation.
2020-10-28 16:04:12 +01:00
242d9e40a2 ENH: consistency update for GeometricField::Boundary constructor
- make patchFieldType default to calculated,
  as per GeometricField constructor
2020-10-28 16:04:12 +01:00
410d38b9d9 ENH: support true/false, yes/no values for FOAM_ABORT (#1896)
- consistent with FOAM_SIGFPE etc.

- centralize code as error::useAbort() static function to avoid
  scattering the logic throughout the code.

ENH: also accept "0" and "1" string values for Switch

- not the normal path for Switch input (eg, from a dictionary), but
  consistent with bool definitions and simplifies string parsing.

  This means that `FOAM_SIGFPE=1 application` will now also work.
2020-10-28 16:04:12 +01:00
9eb73a92e2 TUT: fix use of "constant/triSurface" etc (#1887)
- use bracketed syntax (eg, "<constant>/triSurface") instead for
  implicit case resolution.
2020-10-28 16:04:12 +01:00
5579e7a62b ENH: improve some efficiency in expressions
- use refPtr to simplify some logic.
- avoid copying field if an average will be used
- initialize geometric fields with a uniform value instead of Zero
- minor tweak of method names

- apply bugfix #1889 (longer description elsewhere)
2020-10-28 16:04:08 +01:00
9dc4f76b03 BUG: incorrect boundary type for expressions variables (fixes #1889)
- had calculated boundaries (default) for the evaluated variables,
  which meant they retained their initialized values (usually Zero).

  This normally goes unnoticed, since the boundary values are largely
  irrelevant in the volField expressions. However, when applying
  functions that balk at a zero value - eg, log() - this raises a
  floating point exception.

  These boundary should be zeroGradient, since the evaluated variables
  correspond to the internalField only. Could continue to use
  calculated, but then need to set the calculated boundary values from
  the patch internal field manually.
2020-10-23 11:03:05 +02:00
3e4d9e15c0 BUG: using FatalIOErrorInLookup with incorrect exit type (fixes #1898)
- two occurrences where FatalIOErrorInLookup used exit(FatalError)
  instead of exit(FatalIOError), which caused the error messages
  to be lost.
2020-10-23 09:31:02 +02:00
51b2490258 ENH: additional options for transformPoints and surfaceRefineRedGreen
- add -recentre option to shift points according to the bounding box
  centre before performing other operations

- add -auto-origin to use the bounding box centre as the origin for
  rotations. Has lower priority than the -origin option.

- surfaceTransformPoints now has distinct -read-scale, -write-scale
  options (as per surfaceMeshConvert). Silently accepts -scale as
  equivalent to -write-scale, for backwards compatibility and
  similarity with transformPoints

- add -steps option for surfaceRefineRedGreen for successive
  refinement
2020-10-22 14:59:12 +02:00
4f84aa5362 STYLE: adjustments for code integration
- adjust contributor names to include windows port

BUG: bash script marked as sh (fixes #1890)
2020-10-22 14:52:56 +02:00
d8525f1746 INT: polyline: new extrusion model
Allows specification of extrusion path using blockMesh 'edges' syntax.
See tutorials/mesh/extrudeMesh/polyline

Contribution by Ivor Clifford/Paul Scherrer Institut
2020-10-22 10:13:15 +01:00
e11c072bc4 CONFIG: incorrect BC code templates (fixes #1885)
- autoPtr to Function requires clone() method, not optional copy/move
  argument.

- fix bad character range for 'sed'
2020-10-20 14:23:40 +02:00
f425424eef ENH: add api/patch information to FatalError (#1880)
- can be useful when confronted with partial outputs

- provision for redirecting error/warning
2020-10-19 21:14:22 +02:00
1071d413a3 ENH: add ROOTGREAT constants (symmetry with ROOTSMALL)
ENH: add some scalar constants for .org compatibility (#1881)

Although it can very much be a moving target, it can prove partly
useful to have some compatibility constants/methods.

- The wholesale change of 'GREAT' -> 'great' etc (JAN-2018), makes
  user coding for multiple versions problematic. When
  COMPAT_OPENFOAM_ORG is defined, now define constants (aliases) named
  as per the openfoam.org version. Values, however, remain identical.

- For type-safe dictionary value retrieval, we have the templated
  get<> methods added around NOV-2018 and deprecated the lookupType
  method.

  The .org version followed suit in NOV-2019, but opted for renaming
  the templated lookupType method as a templated 'lookup' method.

  Using this is discouraged, but allowed when COMPAT_OPENFOAM_ORG is
  defined.
2020-10-19 21:14:17 +02:00
cb47decbf1 ENH: add Switch::negate() method (no-op for invalid state)
- flips state while preserving the textual representation.
  Eg, OFF <-> ON, YES <-> NO etc.

- fix test case to avoid triggering abort(), which we cannot try/catch
2020-10-15 17:21:33 +02:00
f7839acd47 ENH: output Enum name list without leading number
- not usually of any interest.
  Unifies code for Ostream and std::ostream operators
2020-10-15 17:21:33 +02:00
f1d9fea6f2 ENH: construct token::compound from object and token from compound (#1879)
- provides a more direct means of generating a compound token without
  an Istream

- add transferCompoundToken() without Istream reference

- mark more token methods as noexcept
2020-10-15 17:21:33 +02:00
de544c9422 COMP: mark autoPtr copy assigment as '= delete' (#639)
- was marked as transitional/deprecated (2018-02), now deleted.

- avoids unexpected stealing of the pointer.
  Use the move assignment it that is the intention.
2020-10-15 17:21:33 +02:00
132ae101f6 COMP: avoid autoPtr copy assignment and implicit casting 2020-10-15 17:21:33 +02:00
3186bd87de BUG: regionToFace: does not stop walking. Fixes #1882
Problem was initial value of zone (transported label) was
still 0. Fixed by properly checking for 'valid' state.
2020-10-15 09:41:21 +01:00
f0d4f7cdc5 ENH: additional cellModel edge() method to return a single edge
STYLE: update cell methods

- avoid shadow variable names, range-for, etc
- simplify coding

STYLE: relocate cellModeller (compatibility) from namespace to a struct

- avoids misleading namespace clutter in doxygen
2020-10-13 12:47:37 +02:00
2d67788c74 ENH: simplify treeBoundBox::calcExtremities
STYLE: avoid shadow variable names, add more doxygen markup

STYLE: cull some unused code from triangleFuncs
2020-10-13 12:47:37 +02:00
2a6cbeb7cb ENH: update and document point/object hit methods
- add point() as unchecked getter method.

- add hitPoint(.., label) convenience method for common combination of
  setHit() + setIndex(label) + setPoint(..)

GIT: remove unused headers, typedefs (point2DHit.H pointHitSort.H)
2020-10-13 12:47:37 +02:00
a475a19d01 CONFIG: bump API to 2010
- mostly reflects minor additions to Pstream methods and blockMesh
  improvements.
2020-10-12 12:52:39 +02:00
f83bc8c22b Merge remote-tracking branch 'origin/master' into develop 2020-10-12 12:52:17 +02:00
9c7aa9727a ENH: add UPstream::parRun(const bool)
- slightly neater code when disabling/restoring parallel state

  New
      const bool oldParRun = Pstream::parRun(false);
      ...
      Pstream::parRun(oldParRun);

  Old
      const bool oldParRun = Pstream::parRun();
      Pstream::parRun() = false;
      ...
      Pstream::parRun() = oldParRun;
2020-10-12 12:51:22 +02:00
295eef471d CONFIG: increment patch level 2020-10-12 11:17:59 +02:00
6ecb4b69b1 SUBMODULE: update for bugfixes, compilation (external-solver, OpenQBMM) 2020-10-12 11:17:48 +02:00
bea6563210 CONFIG: ptscotch header not found on ArchLinux (fixes #1877)
- on ArchLinux, everything is installed under /usr/include/scotch.

  The detection script uses SCOTCH_ARCH_PATH as an initial guess for
  ptscotch as well. However, on the second pass, it has an absolute
  value ("/usr") instead of a logical one ("scotch-system").
  This resulted in the logic for handling scotch+ptscotch subdirs
  being bypassed.
2020-10-12 10:34:49 +02:00
c1ad429564 BUG: parallel foamToEnsight fails depending on lagrangian order (fixes #1873)
- the problem arises when output fields are missing on some
  processors.

  When the information is combined, the resulting HashTables can have
  different insertion orders. This poses an issue when there are hash
  key collisions and thus different chaining.

- Use sorted order.
2020-10-08 18:23:54 +02:00
ea0de58bbf ENH: add ffmpeg support to foamCreateVideo
- additional -tool= option to guide the discovery process
2020-10-07 20:48:04 +02:00
0783bd28d1 ENH: additional face constructors, cellModel methods
- support construct face from subset of labels.

- additional cellModel face() method to return a single face.

- reduce some allocations in cellModel centre/mag methods

STYLE: mark old cellModeller methods as compile-time deprecated

- deprecated in 2017, but not marked as such

STYLE: indentation, spacing in some headers
2020-10-07 09:18:23 +02:00
525ad206be BUG: compilation error for DimensionedField::T() fixes #1868
- incorrectly used const access for the tmp instead of ref()
2020-10-07 09:18:23 +02:00
833ee40904 ENH: add pTraits for uint8_t 2020-10-07 09:17:00 +02:00
568cb050f2 STYLE: place projectCurveEdge, projectEdge into blockEdges namespace
- consistent with other blockEdge types
- adjust some debug output
2020-10-07 09:17:00 +02:00
57a76e2647 Merge branch 'feature-blockMesh-edges' into 'develop'
Feature block mesh edges

See merge request Development/openfoam!383
2020-10-06 09:37:10 +01:00
121c69ef2e TUT: use new 'arc' specification in several tutorials
- in most cases this eliminates manually calculation of circumferential
  points.

TUT: improve parameterization of sphere blockMeshDict

- allow separate parameterization of radius, ratio of inner to outer,
  and the number of divisions in x/y/z and radial directions
2020-10-05 15:45:39 +02:00
1d08ed9be2 ENH: support arc edge specification with origin point
- The arc will frequently enclose an angle less than 180 degrees.
  For the case, it is possible to define the arc by its endpoints
  and its centre (origin) point. For example,

      arc 0 1 origin (0 0 0);

  When defined in the way, any discrepancy in the arc radius for the
  endpoints is resolved by adjusting the origin to ensure that the
  average radius is satisfied.

  It is also possible to specify a \em flatness factor as a multiplier
  of the radius. For example,

      arc 0 1 origin 1.1 (0 0 0);

ENH: minor code cleanup for block edges

ENH: expose point appending as polyList::concat
2020-10-05 14:08:48 +02:00
8939a55653 ENH: relocate blockMesh polyMesh generation into library (for code reuse)
STYLE: adjust blockMesh advanced/non-advanced options

- make -merge-points "non-advanced" (for better exposure)
- make -write-obj "advanced" (-write-vtk is preferred)
2020-10-05 12:36:04 +02:00
179e4cbcf2 STYLE: dimensionSet lookup with LITERAL, not REGEX 2020-10-02 09:19:32 +02:00
f9190e2a3c ENH: primitiveEntry construct with empty token list
- contents to be filled with a later assignment.

  This can help avoid deduction issues when populating from a list of
  tokens, and the templated version is selected:

  ```
  template<class T>
  primitiveEntry(const keyType&, const T&);
  ```

ENH: support construct empty ITstream with given name

- populate contents later by assigment
2020-10-02 09:16:07 +02:00
a415f04431 COMP: cannot compare 'this' for different DynamicList types
- Eg, cannot compare addresses of DynamicList<T,16> and DynamicList<T,8>
  [clang], so compare their cdata pointers instead.
2020-10-01 11:35:59 +02:00
9785029979 BUG: CompactListList transfer leaves old size (fixes #1863)
- use clear/swap paradigm for more code reuse

Note: fixed similar issue with copy/reuse constructor
2020-10-01 11:35:59 +02:00
56c9134ccc ENH: add identity(IntRange) and Istream operator for common types
- provides consistency with identity(label, label) and looks more
  familiar than using labelRange::labels()

- relocates labelRange IO operators to IntRange

ENH: make sliceRange interators random access

STYLE: scalarRanges::match() instead of predicate operator
2020-10-01 11:35:43 +02:00
3b3cffc758 BUG: mapPolyMesh: incorrect addressing. Fixes #1864
Triggered when running e.g. postProcess
2020-09-30 11:44:25 +01:00
27e71c2d9e Merge branch 'Pstream-ranges' into 'develop'
Pstream ranges

See merge request Development/openfoam!382
2020-09-29 10:16:37 +01:00
5dc5ea928a ENH: add UPstream::subProcs() static method
- returns a range of `int` values that can be iterated across.
  For example,

      for (const int proci : Pstream::subProcs()) { ... }

  instead of

      for
      (
          int proci = Pstream::firstSlave();
          proci <= Pstream::lastSlave();
          ++proci
      )
      {
          ...
      }
2020-09-28 14:26:07 +02:00
e18ff114a6 ENH: add UPstream::allProcs() method
- returns a range of `int` values that can be iterated across.
  For example,

      for (const int proci : Pstream::allProcs()) { ... }

  instead of

      for (label proci = 0; proci < Pstream::nProcs(); ++proci) { ... }
2020-09-28 14:25:59 +02:00
f8a8728f8f TUT: update movingCone blockMesh to merge points (#1862)
- wedge geometry, so topology merge results in zero-sized faces.
2020-09-28 11:08:32 +02:00
aca4f077ac ENH: fanPressure - use fanCurve entry if present
- only use implicit legacy handling if the "fanCurve" entry is missing
  and the "file" entry is present.
2020-09-28 11:08:32 +02:00
245ac07312 COMP: add missing include and clone() method to TableFile 2020-09-28 11:08:32 +02:00
43b9b63ab0 ENH: fanPressureFvPatchScalarField - updated fanCurve to use a Function1 2020-09-28 11:08:32 +02:00
12b68e1151 ENH: replace finiteArea timeVaryingUniformFixedValue with Function1 version
- timeVaryingUniformFixedValue -> uniformFixedValue

- allows a variety of functions (eg, coded, expressions, tables, ...)

- more similarity to finiteVolume patch type

STYLE: remove unused timeVarying... from etc/controlDict
2020-09-28 11:08:30 +02:00
bb3660b9a5 ENH: add construct ConstantField with uniform value 2020-09-25 15:30:50 +02:00
97be8fc767 ENH: add finer control to the expected expression types
- adds "future-proofing" for derived expression boundary conditions
  by moving potential failure modes into the base class.
2020-09-25 08:45:16 +02:00
ea42a7a6d4 ENH: change uniformGradient from Function1 to PatchFunction1 2020-09-25 08:39:57 +02:00
0dfdeb36d4 COMP: declare scalarRanges default constructor (gcc-4.8.5)
- failed to properly use the inherited constructors

STYLE: adjust documentation comments
2020-09-25 08:39:57 +02:00
a4c2842420 Merge remote-tracking branch 'origin/master' into develop 2020-09-24 16:17:22 +02:00
cbc0da8a60 CONFIG: increment patch level 2020-09-24 13:46:35 +02:00
d22134ed12 BUG: unexpected treatment of missing fractionExpr (fixes #1858)
- specifying gradientExpr without a valueExpr, a missing fractionExpr
  should be treated as 0 (gradient only), not as 1 (value only)

ENH: improve sanity checks + evaluation short-cuts in exprMixedFvPatchField
2020-09-24 13:46:32 +02:00
1550a12223 BUG: fractionExpr "0" ignored (fixes #1855)
- incorrect branching logic caused the "0" case to be ignored
2020-09-24 11:59:17 +02:00
413ccd5ce3 STYLE: adjust tests and one code instance for updated labelRange 2020-09-23 10:46:04 +02:00
2aa46d4379 STYLE: manage send/recv ensight parallel output with integer range 2020-09-23 10:46:04 +02:00
d204d33c4e ENH: new IntRange class, enhancements to labelRange, sliceRange
- add reverse iterators and replace std::iterator
  (deprecated in C++17) with full definitions

- simplify construction of iterators

- construct labelRange from a single single parameter.
  This creates a (0,len) range.

- make basic constructors forms constexpr.
  Remove unused size checks.

- Derive labelRange from new IntRange template class.
  Allows reuse of base functionality with different integral sizes.

Deprecations:

  - deprecate labelRange::valid() in favour of using
    labelRange::empty() or the bool operator.
    For example,

        if (range) ...  vs older  if (range.valid()) ...

DEFEATURE: drop labelRange::null, scalarRange::null static variables

- turned out to be not particularly useful.
  Can simply use constexpr contructor forms

DEFEATURE: drop labelRange::identity static method

- simply use the single-parameter constructor
2020-09-23 10:45:57 +02:00
ad8ac2fcd0 STYLE: remove unused code references to Pstream::procID() 2020-09-23 09:25:07 +02:00
48cb2de4eb STYLE: adjust send/receive in tests 2020-09-23 09:25:07 +02:00
52025dfb1b STYLE: add END tag for dependency files
- aids when locating truncated files
2020-09-23 09:25:07 +02:00
2cba04e204 STYLE: make some tmp, refPtr constructors constexpr 2020-09-23 09:25:07 +02:00
49ae975b72 Merge branch 'lagragianEvaporation' into 'develop'
New Evap-Cond Lagrangian model  (FuchsKnudsen)  for solution (liquid + solid) droplets

See merge request Development/openfoam!377
2020-09-22 16:37:02 +01:00
274bb0740e STY: Headers and code style 2020-09-22 16:35:53 +01:00
11d17fec5f ENH: Adding evaporation-condensation lagragian model for solution
1) Adding LiquidEvapFuchsKnudsen model for lagrangian evaporation.
   This models is based on a diffusion type of evaporation/
   condensation on particles composed of solution (liquid + solid).

2) Adding modes of calculating the particle rho and volume change.
   The new keyword in constantProperties is 'volumeUpdateMethod'
   which three options:
        a) constantRho
        b) constantVolume
        c) updateRhoAndVol

   The old keyword 'constantVolume' true/face is still valid

3) The entry rho0 is now optional for multicomponent parcels.
   If defined , it is used, but if it is not the actual mixture
   provided is used to calculate rho0 of the particle.
   T0 is still used as initial T and Cp0 is over-written in the
   multicomponent cloud but still required.

4) Adding tutorial for evaporation/condensation model
2020-09-22 16:35:53 +01:00
973e2d4e2d COMP: remnant foam-extend code in faMatrix::setValues (fixes #1834)
BUG: faMatrix::residual changes source vector (fixes #1835)

ENH: improve code alignment between faMatrix and fvMatrix

- support setValues() with a single value
2020-09-16 17:27:56 +02:00
bf3b4fabb4 ENH: UniformList to wrap a single value into a list-like container
- refactor UniformField accordingly
2020-09-16 17:27:56 +02:00
0d08942bf3 STYLE: mark globalMeshData::ListPlusEqOp as deprecated
- can use ListOps::appendEqOp as the more general form.
  Note that this uses a different template parameter.
  Eg,
      `globalMeshData::ListPlusEqOp<labelList>()`
  vs. `ListOps::appendEqOp<label>()`
2020-09-16 17:27:56 +02:00
0a1cd580ac ENH: improvements for nastran surface writer
- select default nastran PLOAD2 or PLOAD4 based on field type.
  Default to PLOAD2 for scalar types and PLOAD4 for vectors etc.

- relocate nastran SHELL/MAT cards.
  Previously wrote at the end of the file, now emit when writing the
  geometry itself. This improves modularity (of code and files)

- initial support for common geometry file for nastran
2020-09-16 17:27:56 +02:00
7d203443c3 ENH: refactor surface writer collated time management (#1600)
- abstracted out from ensight surface writer for potential reuse by
  other surface writers.
2020-09-16 17:27:56 +02:00
f8ffee8135 ENH: support fieldScale for more surface writers 2020-09-16 17:27:56 +02:00
a9bf69b551 ENH: suppress surface Face-id field if writer manages that itself (#1600)
- for CAE formats such as abaqus, nastran, starcd, etc, the element id
  is already part of the output format itself. For these cases, there
  is no use in generating an additional "Ids" field.

ENH: add code to ignore negative face ids

- these will arise from very special cases, such as when a
  solid element and side are encoded into a single integer.

BUG: starcd surface values output did not use original face ids
2020-09-16 17:27:56 +02:00
a001c0d2fa BUG: volPointInterpolation: fixes #1831 2020-09-16 15:30:09 +01:00
52e0ebca57 ENH: gradingDescriptor(s) correct() and normalise() methods
- single entry point to handle negative expansions etc.
  Reduces typos and forgotten code (as per #1841)
2020-09-16 09:47:08 +02:00
9762b547fe BUG: gradingDescriptor stream input ignores negative expansion (Fix #1841)
- mostly only tripped when using fractional edge grading, since this
  is where the list reading is used. Overseen in commit 7da0b5bee1.
2020-09-16 09:25:28 +02:00
ab55157358 BUG: snappyHexMesh: fixes #1836.
When truncating layers in one go (nBufferCellsNoExtrude -1) it
should set the nCells per face to be the min of the number of points
per edge.
2020-09-10 14:09:58 +01:00
c9ab12cb3d ENH: IOobject: print some more info 2020-09-10 14:09:57 +01:00
1e95af4d57 STYLE: use more generic terms allow/deny for selections 2020-09-09 13:54:34 +02:00
d4cd87830d BUG: Changing rho mixing to volume-based in rhoThermo. Fixes #1812. 2020-09-08 15:24:12 -07:00
7be3092414 BUG: Fixing parallel writing for interfaceHeight FO. Fixes #1788 2020-09-08 09:20:51 -07:00
be99805986 ENH: isolate config/version information from regular globals
- slight speed gain for recompilation and provisions for future
  refactoring
2020-09-07 17:36:26 +02:00
9423d2bd83 CONFIG: improve support for compiler/link options (#1830)
- introduce WM_COMPILE_CONTROL variable to convey control information
  into the build rules.

  The convention (as per spack):
      - '+' to select a feature
      - '~' to deselect a feature

  Eg, to select the gold linker, and disable openmp
  (spaces are not required):

      WM_COMPILE_CONTROL="+gold ~openmp"

CONFIG: accept FOAM_EXTRA_LDFLAGS for AMD, gold, Mingw linkers

CONFIG: generalize PROJECT_LIBS (-ldl used almost universally)
2020-09-07 09:45:51 +02:00
fbfcdfc723 ENH: allow default parameter for Tuple2 (#1827)
- simplifies cases where Tuple2 is used as a Pair replacement
  (for output format reasons)
2020-09-07 09:37:05 +02:00
1c71c7cb23 Merge remote-tracking branch 'origin/master' into develop 2020-09-03 12:04:45 +02:00
916dcc85a5 ENH: bin/tools/git-find-non-ascii: find non-ASCII chars in source code 2020-09-03 12:04:04 +02:00
73057447a2 COMP: pass-through targetType for a few Allwmake files (#1824) 2020-09-03 11:35:18 +02:00
4735776246 COMP: pass shell args for Allwmake-mpi (#1824) 2020-09-03 10:15:12 +02:00
0e6df58c70 STYLE: simpler construct for empty tmp field in volFieldValue
- originally (incorrectly) was a Field(0.0), which was generalized
  to Field(Zero), but Field() is the correct form

STYLE: rename 'mustGet' to more standard 'mandatory' variable
2020-09-03 09:26:37 +02:00
b2feb6a8d8 ENH: avoid redundant IO in readFields function object (fixes #1825)
- read header info once and reuse
- short-circuit logic to avoid unneeded checks
- additional debug information if field cannot be found

STYLE: remove unused old code remnants from #1206
2020-09-03 09:07:31 +02:00
719d3f77be COMP: Intel compiler bug with inheriting constructors (fixes #1821)
- the compiler reports

      Internal error loop: assertion failed:
      find_seq_in_lookup_table: seq_number not found
      (shared/cfe/edgcpfe/il.c, line 4118)

  Seems to be the same as the bug report
  https://community.intel.com/t5/Intel-C-Compiler/Internal-error-loop-assertion-failed-find-seq-in-lookup-table/td-p/1087603

This _should_ be fixed in icc 17.0 update 1, but appears to have
struck here as well.

- workaround: explicitly construct member elements.
2020-09-01 11:49:27 +02:00
8d55c37b2f BUG: missing tab in actuationDiskSource output (fixes #1819) 2020-08-31 15:17:54 +02:00
fa364eda12 BUG: inconsistency between constructor and output (fixes #1816)
- slipped in with changes to csvTableReader (commit 59ed3ba18d) so
  only affects the 2006 version.

- adjust constructor to expect "componentColumns", but also accept
  "valueColumns" as 1912 and earlier-compatibility. This not only
  fixes the reported bug, but also ensure proper compatibility with
  older files.

ENH: use "refColumn" instead of "timeColumn" for csvTableReader

- consistent with the CSV Function1.
  Support 'timeColumn' as 1912 and earlier-compatibility.

TUT: remove unused table-reader entry
2020-08-31 15:17:32 +02:00
a85446cad3 DOC: update BuildIssues for mingw changes 2020-08-12 17:02:53 +02:00
dd1c2edb6b COMP: wmake findObjectDir fails for non-project directories (fixes #1807)
- experienced while reusing src/Pstream/Allwmake-mpi to create
  additional mpi-layers after installation. Since the copied sources
  are not located within the OpenFOAM source-tree (and/or the
  source-tree is non-writable), it should not and does not use the
  central build/WM_OPTIONS directory.

  However, when exploring for the appropriate local Make directory, it
  searched for the current '.' directory instead of checking for the
  resolved directory.

  This fails, since there is no src/Pstream/Make directory.
  Must check for src/Pstream/mpi/Make directory first!

- Adjust wclean to always remove a local build directory
  (Make/WM_OPTIONS) for additional safety.
  After which, attempt to remove central build/WM_OPTIONS version too.
2020-08-12 12:33:34 +02:00
18c68e6b74 ENH: add bin/tools/createMingwRuntime helper
Script to copy/create mingw run-time installation from the Linux
  cross-compilation. Packs everything into a tar or a zip file.

  To accommodate Windows, all .dll files are also placed in the
  platforms bin/ directory where they are easily found via the PATH.

  Futhermore, ThirdParty dll files (including those from mingw itself)
  are also placed in the same directory.

---
Steps
  - bundles common files and directories (bin, etc, META-INFO, ...)

  - copies .exe files from FOAM_APPBIN and .dll files from FOAM_LIBBIN
    to the new target platforms/win64MingwDPInt32Opt/bin.

  - copies mingw sys-root .dll files to the new target
    platforms/win64MingwDPInt32Opt/bin

  - copies other ThirdParty dll files (scotch, fftw, etc) to
    platforms/win64MingwDPInt32Opt/bin

  - copies tutorials (can be deactivated)

---
Note
    Can only be called when the linux64Mingw environment is active.
2020-08-11 16:39:43 +02:00
a6e86caa62 ENH: improvements for FOAM_CONFIG_ETC
- handle relative directory names for FOAM_CONFIG_ETC
2020-08-11 13:16:03 +02:00
6a1efe3b5c ENH: support construct/reset refPtr from autoPtr and unique_ptr (#1775)
- makes it easier to use in combination with various 'New' selectors,
  which mostly return an autoPtr.

ENH: add very simple FFT test

- basic sanity test that the library links properly
2020-08-11 13:15:28 +02:00
e94fdee58d STYLE: add hints about setting GMP/MPFR within etc/config.*sh/CGAL 2020-08-10 14:38:41 +02:00
6e2b7be983 ENH: direct access to wrapped ifstream/ofstream with compression (#1805)
- previously hidden as Detail::[IO]FstreamAllocator, now exposed
  directly as [io]fstreamPointer, which allows reuse for
  std::ifstream, std::ofstream wrapping, without the additional
  ISstream, OSstream layers.

  These stream pointers have some characteristics similar to a
  unique_ptr.

- restrict direct gzstream usage to two files (fstreamPointers.C,
  gzstream.C) which improves localization and makes it simpler to
  enable/disable with the `HAVE_LIBZ` define.

  The HAVE_LIBZ define is currently simply hard-coded in the
  Make/options.

  If compiled WITHOUT libz support:
    - reading gz files : FatalError
    - writing gz files : emit warning and downgrade to uncompressed
    - warn if compression is specified in the case controlDict
      and downgrade to uncompressed

ENH: minor updates to gzstream interface for C++11

- support construct/open with std::string for the file names.

CONFIG: provisioning for have_libz detection as wmake/script
2020-08-10 12:40:08 +02:00
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
1178fc190b CONFIG: add runtime settings for mingw cross-compiled binaries
- WM_ARCH=win64 to indicate the runtime environment

ENH: cross-compile wmake toolchain for the target-side as well
2020-08-06 19:36:19 +02:00
44052de594 TUT: skip some tutorials when dynamicCode is not available
- silence failed restoration of controlDict from controlDict.orig
  (idempotent?)
2020-08-06 19:34:20 +02:00
9ef144118d BUG: directory information spoils "wmake -show-cxx" (fixes #1799)
- the various information queries MUST be executed with
  the '--no-print-directory' or risk polluting values
  in the information queries.

  This is mostly seen with the 'canCompile' test for tutorials running
  in parallel.
2020-08-06 18:30:03 +02:00
67a17f7c78 Merge branch 'functionObject-dispatch' into 'develop'
ENH: finer granularity for handling functionObject failure (#1779)

See merge request Development/openfoam!380
2020-08-06 17:15:09 +01:00
583905fdeb BUG: directory information spoils "wmake -show-cxx" (fixes #1799)
- the various information queries MUST be executed with
  the '--no-print-directory' or risk polluting values
  in the information queries.

  This is mostly seen with the 'canCompile' test for tutorials running
  in parallel.
2020-08-06 17:52:02 +02:00
5424c5e5bc ENH: finer granularity for handling functionObject failure (#1779)
- additional "errors" entry with enumerated values
  (default|warn|ignore|strict) for defining warning or error at
  construct or runtime stage

- default : construct = warn, runtime = fatal
- warn    : construct = warn, runtime = warn
- ignore  : construct = silent, runtime = silent
- strict  : construct = fatal, runtime = fatal

The errors control can be added at the top-level and/or for individual
function objects.
2020-08-06 07:45:12 +02:00
f39c1d3c57 Merge branch 'comp-cyclic-dependencies' into 'develop'
remove cyclic dependencies for phase systems

See merge request Development/openfoam!379
2020-08-05 19:02:59 +01:00
a192095ce0 COMP: remove unused variable from phasePressureModel 2020-08-05 18:56:25 +01:00
99e20b3b6f ENH: combine some phaseSystem selectors into regular .C files
- reduces the number of files, eases code refactoring
2020-08-05 18:56:24 +01:00
93ed933770 STYLE: use unitConversion degToRad() from instead of separate value 2020-08-05 18:56:24 +01:00
915c0785ae ENH: avoid phaseSystem cyclic dependencies, reduce number of libraries
Reduce the number of phaseSystems libraries:

- phaseSystems previously had a number of smaller libraries to provide
  interface and model properties, etc. This potential flexibility was
  never actually used anywhere, but causes cyclic dependencies between
  phaseSystem and the models (and turbulence) that causes extreme
  difficulty for mingw linking (issue #1238).

- libincompressibleMultiphaseSystems
  - removed: libmassTransferModels

- libmultiphaseSystem
  - removed: libcompressibleMultiphaseEulerianInterfacialModels

- libreactingMultiphaseSystem
  - removed: libreactingPhaseSystem
  - removed: libreactingEulerianFvPatchFields
  - removed: libreactingEulerianInterfacialCompositionModels
  - removed: libreactingEulerianInterfacialModels
  - removed: libmultiphaseReactingTurbulenceModels

- libreactingTwoPhaseSystem
  - removed: libreactingPhaseSystem
  - removed: libreactingEulerianFvPatchFields
  - removed: libreactingEulerianInterfacialCompositionModels
  - removed: libreactingEulerianInterfacialModels

Avoid duplicate symbol for phaseCompressibleTurbulenceModels

  Common turbulence models are defined in libreactingMultiphaseSystem,
  and libmultiphaseReactingTurbulenceModels is now redundant.

  The libtwoPhaseReactingTurbulenceModels extends the common models
  for reactingTwoPhaseSystem.
2020-08-05 18:56:23 +01:00
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
42ce617b43 ENH: prefer 'model' keyword instead of 'RASModel',... (#149)
- since the context (laminar/RAS/LES) is already given by the
  sub-dictionary, it is redundant to use as prefix as well.

- silently support the longer names as compat methods
2020-08-05 15:29:03 +02:00
7051abc371 TUT: fix run/clean scripts syntax 2020-08-04 15:12:40 +02:00
14c9582458 ENH: provide wordPair typedef in Pair.H, and separate wordPair.H 2020-08-04 12:13:33 +02:00
6b074985ac ENH: improve separation of turbulence models macros (define vs make) 2020-08-03 16:28:21 +02:00
65d9cd503a COMP: stricter inclusion of headers in turbulenceModels
- include fvOptions header, Smagorinsky header
2020-07-31 13:08:33 +02:00
23ea498c08 BUG: inconsistent check in non-const '->' dereference (tmp, refPtr)
- old code just checked for pointer vs non-pointer.
  Should actually treat CREF and REF types differently
  Overseen in commit be058bec7d. Only affects develop branch

ENH: improved naming consistency in tmp, refPtr

- also use long-form to check for pointer type instead of the isTmp()
  method. Makes differences between PTR, CREF, REF easier to spot.

STYLE: typeName() for tmp, refPtr is static
2020-07-30 10:20:07 +02:00
e56e195ab5 ENH: support objectRegistry store of refPtr (as per tmp) 2020-07-30 09:45:55 +02:00
487002d2e2 STYLE: consistent file naming (rigidBodyDynamics,sixDoFRigidBodyMotion) 2020-07-30 09:45:13 +02:00
28eae0573b BUG: The option to cache the limiter field was not working
In fvSolution is possible to cache the limiter. This surface field
is stored in the database to be read later.

The internal tmp management of the field was not working properly.
2020-07-29 11:14:12 -07:00
d073724232 BUG: Limiting min alpha to SMALL to avoid zero transient term of turbulence model
In certain turbulence models such as kEpsilon, kOmegaSST, etc when used
in the multiphase context throw an error in the preconditioner. This
is due to alpha being zero. Fixes #1789.
2020-07-28 12:40:06 -07:00
d3d03de48c DOC: relocate cross-compile (mingw) information to wiki content 2020-07-28 15:48:42 +02:00
74a062d1d5 Merge remote-tracking branch 'origin/master' into develop 2020-07-28 08:42:12 +02:00
65d640e58e BUG: potential memory leaks in HashPtrTable (#1787)
- using HashPtrTable::set() with the same key twice did not guarantee
  proper cleanup of memory since it simply used the underlying
  HashTable::set() without doing anything about the old memory. Now
  check for pre-existing storage and delete it when it does not
  correspond to the newly stored pointer.

  This problem is independent of potential memory slicing previously
  flagged (#1286) and only partially resolved.
2020-07-28 08:40:43 +02:00
fa71840d8b ENH: add get() retrieval of a pointer from PtrLists, HashPtrTable
- naming similarity with autoPtr, unique_ptr and other containers.

  For UPtrList derivatives, this is equivalent to the existing
  operator(). The read-only variant is also equivalent to the
  single-parameter 'set(label)' method.

  With PtrList<T> list(...) :

      const T* ptr = list.get(10);
      if (ptr)
      {
          ptr->method();
      }

  vs.
      if (list.set(10))
      {
          list[10].method();
      }

  For HashPtrTable there is only a read-only variant which is equivalent
  to testing for existence and for value.

  With HashPtrTable<T> hash(...) :

      const T* ptr = list.get("key");
      if (ptr)
      {
          ptr->method();
      }

  vs.
      if (list.found("key"))
      {
          // Fails on null pointer!!
          list["key"].method();
      }

Use of get() is largely a matter of taste or local coding requirements
2020-07-28 08:40:43 +02:00
872c9d370b ENH: support emplace methods and std::unique_ptr for PtrList-derivatives
- emplace methods
  Eg,
      m.internalCoeffs().emplace(patchi, fc.size(), Zero);
  vs.
      m.internalCoeffs().set(patchi, new Field<Type>(fc.size(), Zero));

- handle insert/append of refPtr wherever tmp was already supported

COMP: incorrect variable names in PtrListOpsTemplates.C
2020-07-28 08:40:43 +02:00
4110699d90 ENH: HashTable::emplace_set() method, HashPtrTable support for unique_ptr
- forwarding like the emplace() method, but overwriting existing
  entries as required

- propagate similar changes to HashPtrTable

  For example, with HashPtrTable<labelList> table(...) :

  With 'insert' semantics

      table.emplace("list1", 1000);

  vs
      if (!table.found("list1"))
      {
          table.set("list1", new labelList(1000));
      }
  or
      table.insert("list1", autoPtr<labelList>::New(1000));

  Note that the last example invokes an unnecessary allocation/deletion
  if the insertion is unsuccessful.

  With 'set' semantics:

      table.emplace_set("list1", 15);

  vs
      table.set("list1", new labelList(15));
2020-07-28 08:40:43 +02:00
c77afff48f COMP: fix sloppy (and now ambiguous) use of PtrList::set()
- constructs such as the following will no longer worked, but that is
  also a good thing.

     ptrlist.set(i, scalarField(nFaces, Zero));

  this called set(.., const tmp<scalarField>&), which meant under
  the hood:

     - create local temporary const scalarField&
     - wrap as const tmp&
     - use tmp::ptr(), to clone the const-ref

  This implies an additional allocation (for the const scalarField&)
  which is immediately discarded. Doubtful that compiler optimization
  would do anything.
2020-07-28 08:35:42 +02:00
6461eec886 CONFIG: increment patch level 2020-07-27 10:28:44 +02:00
3455d556c4 BUG: potential memory leaks in HashPtrTable::set (#1787)
- backported fix from develop

COMP: incorrect variable names in PtrListOpsTemplates.C
2020-07-27 10:28:40 +02:00
540589fc22 SUBMODULE: visualization installation prefix on older ubuntu (#1757) 2020-07-27 09:58:24 +02:00
dc52e5ae67 STYLE: use range-for with labelHashSet in MULES 2020-07-27 09:47:33 +02:00
d5884c8d85 STYLE: use HashSet xor instead of two operations (faceZoneSet)
STYLE: use global operator instead of HashSet -= operator
2020-07-27 09:47:33 +02:00
6e75cf2e7d STYLE: unify HashSet list insertion (use iterator pair) 2020-07-27 09:47:33 +02:00
85e74567ff ENH: added subtraction operator for HashSet
- offers similarity with bitSet

STYLE: remove remnant parent::operator= from HashSet

STYLE: code formatting in HashTables
2020-07-27 09:47:33 +02:00
2de4501e47 ENH: add testFunctionObjects library with fakeError function object
The fakeError function object emits FatalError at different stages (or
does nothing), which is useful for testing purposes (issue #1779).

Can request errors from constructor, execute and write methods.
2020-07-24 09:04:07 +02:00
c411c0cc09 SUBMODULE: adios (style), external-solver (bugfix), visualization (style) 2020-07-23 18:12:06 +02:00
e8b06ac222 STYLE: remove incorrect branch condition in setExprFields 2020-07-23 16:52:15 +02:00
181e27a90f ENH: improve abort/exception handling in error class (#1780)
- previously setting FOAM_ABORT would preempt checks for throwing
  exceptions.

  Now check for throwing first, to allow try/catch code to do its job.
  However, ignore exception throwing for abort(). These are used
  infrequently in the code, but indicate that recovery is deemed
  impossible.

STYLE: use unique_ptr for internal stream buffer management
2020-07-22 19:11:57 +02:00
707b29bbbd STYLE: minor doc and formatting changes 2020-07-22 19:11:28 +02:00
bcda061f54 ENH: checkMesh: improved checking on writeFields. Fixes #1786. 2020-07-23 17:26:09 +01:00
d3c76d8ec8 ENH: ListOps: added findIndices with predicate 2020-07-23 17:26:09 +01:00
f1e950ce83 ENH: snappyHexMeshDict: document small region removal. See #1772 2020-07-23 17:26:09 +01:00
45982d97fa BUG: Correct evaluate function for ddt0 in CrankNicolson scheme. Fixes
The function evaluate was returning true every outer loop, triggering
the re-calculation of ddt0 in every outer loop.

The evaluation of the term ddt0 should be performed once per time step.
The corrected function updates the timeIndex of ddt0 to avoid the
re-evaluation of this term in the outer loops.
2020-07-21 16:23:13 -07:00
be058bec7d ENH: support writable reference for tmp (#1775)
- improves flexibility. Can tag a tmp as allowing non-const access to
  the reference and skip additional const_cast in following code. For
  example,

      tmp<volScalarField> tfld(nullptr);
      auto* ptr = getObjectPtr<volScalarField>("field");
      if (ptr)
      {
          tfld.ref(*ptr);
      }
      else
      {
          tfld.reset(volScalarField::New(...));
      }
      auto& fld = tfld.ref();

ENH: renamed tmpNrc to refPtr

- the name 'refPtr' (reference|pointer) should be easier to remember
  than tmpNrc (tmp, but non-ref-counted).

- provide tmpNrc typedef and header for code compatibility

NOTE

- in some places refPtr and tmp can be used instead of a
  std::reference_wrapper for handling external references.

  Unlike std::reference_wrapper, it can be default constructed
  (holding nothing), whereas reference_wrapper may need a dummy
  reference. However, the lifetime extension of references _may_ be
  better with reference_wrapper.
2020-07-21 11:02:20 +02:00
5acb5f3580 STYLE: rename/adjust local pointer naming and handling 2020-07-20 16:59:19 +02:00
dc6c3c8add TUT: Correction for Alltest 2020-07-20 10:19:54 +01:00
065db9a7b8 Merge branch 'enh-memory-cleanup' into 'develop'
autoPtr/tmp cleanup

See merge request Development/openfoam!378
2020-07-17 16:29:16 +01:00
fa86a98482 BUG: Minor correction to lumpedPointState.C for debug build 2020-07-17 14:09:34 +01:00
6d4928d585 ENH: extend nullptr check for tmp ptr() method (#1775)
- Cannot call ptr_->clone() with a null pointer!
2020-07-16 15:09:57 +02:00
fde93b6603 STYLE: compile-type deprecate empty() method for autoPtr/tmp (#1775)
- autoPtr: less clutter using plain tests with the bool operator

    (!ptr)  vs  (ptr.empty())
    (ptr)   vs  (!ptr.empty())

- tmp: was entirely unused.
2020-07-16 15:09:57 +02:00
35a0fd3e8e ENH: reset tmp via assignment from literal nullptr (#1775)
- previously this was marked as '= delete' for consistency with
  assignment from an empty pointer being a runtime error.
  However, these can be considered semantically different and it makes
  sense to permit this as equivalent to reset(nullptr).

  This change does not break existing code since the operator was
  previously unavailable (deleted).

STYLE: refactor tmp operator=(T*)

- delegate to reset() after initial checks
2020-07-16 15:09:56 +02:00
59bfbb9541 ENH: simpler, more consistent checks for tmp validity (#1775)
- Previously considered to be valid() if it was any reference
  (null or non-null) or a non-null pointer.

  This appears to be a holdover from old code (pre-2015) where
  reinterpret_cast<..>(0) was used instead of the NullObject.

  A reference via a null pointer isn't really possible anywhere. Even
  for things like labelList::null(), they now use the NullObject,
  which has a non-zero memory location.

- now simply check for a non-zero memory address. Regardless of
  pointer or referenced object.
2020-07-16 15:09:56 +02:00
d282d1a285 STYLE: minor code reduction/simplification for tmp (#1775)
- combine reset() methods by adding a default parameter

- improve top-level visibility of empty/valid/get methods for symmetry
  symmetry with autoPtr, future adjustment
2020-07-16 15:09:56 +02:00
12c91b9472 STYLE: check autoPtr as plain bool instead of valid()
- cleaner code, more similarity with unique_ptr

  Now
      if (ptr)
      if (!ptr)

  instead
      if (ptr.valid())
      if (!ptr.valid())
2020-07-16 11:39:24 +02:00
9af3f85cf9 STYLE: simplify short-circuit involving autoPtr (#1775)
- with '&&' conditions, often better to check for non-null autoPtr
  first (it is cheap)

- check as bool instead of valid() method for cleaner code, especially
  when the wrapped item itself has a valid/empty or good.
  Also when handling multiple checks.

  Now
      if (ptr && ptr->valid())
      if (ptr1 || ptr2)

  instead
      if (ptr.valid() && ptr->valid())
      if (ptr1.valid() || ptr2.valid())
2020-07-16 10:17:25 +02:00
3baebcb101 STYLE: replace uses of autoPtr::empty() with bool check (#1775)
- less clutter using plain tests with the bool operator:

      (!ptr)  vs  (ptr.empty())
      (ptr)   vs  (!ptr.empty())
2020-07-16 08:58:22 +02:00
53eda1c4f1 ENH: use boolVector for NURBS3DVolume constraints
- same as FixedList<bool,3> for I/O
2020-07-15 14:34:52 +02:00
5e954d2881 STYLE: use autoPtr instead of tmp for holding sensitivities
- since only pointers are stored, autoPtr is better fit than tmp
2020-07-15 13:41:15 +02:00
e2021550fd Merge branch 'feature-dynamicLibrary' into 'develop'
Feature dynamic library - issue #1737

See merge request Development/openfoam!375
2020-07-14 16:41:39 +01:00
5dc04530d9 COMP: additional linkage libraries for AMD compiler (#1627) 2020-07-14 12:17:09 +02:00
1e7c6ea2f1 ENH: mutable libs() access in Time and other classes (#1737)
- This reflects the pre-existing coding situation where const_cast was
  used throughout to effect the same.

STYLE: fix private/protected access

- CodedField, codedMixedFvPatchField
2020-07-14 11:19:05 +02:00
41d3e6f1d4 ENH: various dlLibraryTable improvements/refinements (#1737)
- libs() singleton method for global library handling

- explicit handling of empty filename for dlLibraryTable open/close.
  Largely worked before, but now be more explicit about its behaviour.

- add (key, dict) constructor and open() methods.
  More similarity to dimensionedType, Enum etc, and there is no
  ambiguity with the templated open().

- construct or open from initializer_list of names

- optional verbosity when opening with auxiliary table,
  avoid duplicate messages or spurious messages for these.

- basename and fullname methods (migrated from dynamicCode).

- centralise low-level load/unload hooks

- adjust close to also dlclose() aliased library names.
2020-07-14 11:19:05 +02:00
950e667259 ENH: snappyHexMesh: optionally remove 'small' regions. Fixes #1772.
This is for a very specific use case where the faceZones are
imprinted after meshing the normal geometry. This sometimes
splits off badly connected bits of the mesh. One way to remove
these is to use e.g. subsetMesh. This embeds the
same functionality inside snappyHexMesh.
2020-07-13 15:29:12 +01:00
a86860430a BUG: checkMesh: index into surfaceScalarField. Fixes #1771. 2020-07-13 13:02:07 +01:00
331e86cf17 BUG: checkMesh: index into surfaceScalarField. Fixes #1771. 2020-07-13 13:00:13 +01:00
8594fb43c8 ENH: snappyHexMesh: Cleanup of parallel cyclics. See #1731. 2020-07-13 09:45:00 +01:00
6365bab800 ENH: update lemon version and linkage directive (#1768)
- replace `%namespace` directive with simpler `%static` directive.

  We always encapsulate Lemon parser routines in an anonymous
  namespace, so a simpler static linkage directive suffices.

  This reduces the size of the Lemon patch (program and template).
2020-07-10 12:01:58 +02:00
a088bda4d2 ENH: use unique_ptr for memory management of profiling
- makes it easier to distinguish between pointers referring to pool
  data versus pointers actually holding storage, avoids
  manual demand-driven deletion and autoPtr.

ENH: simplify/improve Pstream profiling

- times now double (not scalar) for consistency with what cpuTime
  delivers

- use bool to track suspend state
2020-07-09 16:17:33 +02:00
b64ada3dde BUG: argList: use fileHandler to read decomposeParDict. Fixes #1765 2020-07-09 15:11:39 +01:00
c06c63f49f ENH: snappyHexMesh: handle parallel cyclics. Fixes #1731. 2020-07-08 16:48:14 +01:00
423bbcefa8 Update Build.md 2020-07-03 09:48:50 +01:00
9b78472e06 DOC: Updated header doc - see #1756 2020-07-02 09:17:48 +01:00
6d965d699b BUG: mergeOrSplitBaffles -dict option ignored (fixes #1759)
- regression from f721b5344f
2020-07-01 18:41:31 +02:00
0b41521d98 CONFIG: avoid triggering dash expansion bug (fixes #1757)
- use long form to avoid dash 0.5.8 error (ubuntu bionic)

- consolidate the prefix handling into modules/Allwmake
2020-07-01 16:20:13 +02:00
968ce0290d DOC: Corrected header documentation - see #1756 2020-07-01 14:59:11 +01:00
ae76b38270 BUG: TableBase: illegal reference. Fixes #1753 2020-07-01 14:53:26 +01:00
0dc07fb00f CONFIG: reset version 2020-06-30 12:45:36 +01:00
b45f8f6f58 MOD: updated OpenQBMM reference 2020-06-29 18:16:22 +01:00
294cfc4a77 REL: Updated completions cache 2020-06-29 17:27:54 +01:00
780c156103 REL: Updated config to v2006 2020-06-29 17:27:54 +01:00
538d749220 REL: Updated headers to version v2006 2020-06-29 17:27:54 +01:00
b244cd1b21 Merge remote-tracking branch 'origin/master' into develop 2020-06-29 11:08:27 +01:00
d1dae159ad BUG: Corrected use of ddtCorr off 2020-06-29 11:07:09 +01:00
b325cb86c0 TUT: added mixerVesselAMI2DRefined to show example of AMI with topology change 2020-06-29 11:07:09 +01:00
2ba6243862 CONFIG: refine handling of git information for debian builds
- When OpenFOAM is under git control and a 'debian/' directory exists,
  this could mean two things:

  1) Additional debian control has been added to OpenFOAM
  2) OpenFOAM has been imported into a debian project

For the case that OpenFOAM has been imported into a debian project,
using the git information would be highly misleading. There will be no
OpenFOAM SHA1 correspondence.

However, if additional debian control has been added to OpenFOAM the
SHA1 will be valid.

The ad hoc solution is to use an additional "openfoam.debian"
directory to flag the addition of debian controls into openfoam.

When a "debian/" directory exists without a "openfoam.debian", assume
that the OpenFOAM has been imported into debian and do not use the SHA1.
2020-06-29 10:33:30 +02:00
5754beeab4 COMP: remove old, unused/unusable lnInclude path (fixes #1752) 2020-06-29 09:32:14 +02:00
d93dd11ae4 ENH: add heatTransferCoeff caseDicts template (#1751) 2020-06-26 14:48:05 +02:00
df7044845e GIT: remove whitespace, backslash escape angle brackets in comments
- fix older '> >' template parameters as '>>'
2020-06-26 12:28:49 +02:00
51dd8f1c63 CONFIG: increment patch level 2020-06-26 10:35:55 +02:00
6534245359 BUG: incorrect lookup name in ReynoldsAnalogy (fixes #1751)
- used fluidThermo::typeName instead of fluidThermo::dictName
  within the Cp() method.
2020-06-26 10:32:13 +02:00
b6bf3502a3 BUG: Adding phasePropertyName to basicThermo constructor (fixes #1745) 2020-06-26 10:32:13 +02:00
c49d923392 BUG: Correcting htc definition to avoid negative values 2020-06-26 10:32:13 +02:00
4248fdcd96 BUG: windows IOobject::path() incorrect from absolute (fixes #1738)
- only checked if it started with '/' and not 'd:/' (for example).
2020-06-26 10:32:13 +02:00
1bd5d03ea6 TUT: Adjusting settings for tutorials climbingRod and mixerVessel2D 2020-06-25 11:07:53 -07:00
f0c5f762d6 BUG: Adding phasePropertyName to basicThermo constructor (fixes #1745) 2020-06-25 08:35:21 -07:00
6cf560338e BOT: Added contributors file 2020-06-25 14:57:07 +01:00
f51cac3ad1 ENH: SemiImplicitSource: allow Function1 for Su,Sp. Fixes #1750. 2020-06-25 14:54:46 +01:00
7b7142536d DOC: additional documentation in MappedFile 2020-06-25 11:54:38 +02:00
0a7eb6e6dc BUG: bad names if ensight mask contains NO placeholder (fixes #1747)
- affects ensightSurfaceReader only.

  If there are no `*` characters, protect against replacement.
  Otherwise it would attempt to replace a zero-length string with
  a single `0`, which results in prepending the name.

STYLE: ensightSurfaceReader constructor explicit
2020-06-25 11:54:38 +02:00
013a52238d COMP: some resolved compiler warnings 2020-06-25 10:02:50 +01:00
b98e060967 Merge branch 'feature-ami' into 'develop'
AMI code enhancements

See merge request Development/openfoam!367
2020-06-24 22:12:38 +01:00
6e716c66d5 ENH: pimpleFoam - ddtCorr now optional 2020-06-24 22:10:20 +01:00
88dd3a1818 ENH: pimpleControl - added ddtCorr flag 2020-06-24 22:10:20 +01:00
11ed7a0efe ENH: cyclicAMIFvPatch - added hooks to correct delta coeffs and vecs 2020-06-24 22:10:20 +01:00
438f38bb61 ENH: surfaceInterpolation: extended patch override of geometry calculation. 2020-06-24 22:10:20 +01:00
7c1c9fee0c ENH: Updated AMI dependent code 2020-06-24 22:10:20 +01:00
66d270b924 DOC: cyclicAMI - added reference paper to header; function documentation 2020-06-24 22:10:19 +01:00
1e3cd399f2 WIP: dynamicMotionSolverFvMeshAMI - reset Uf 2020-06-24 22:10:19 +01:00
c6e18e7593 ENH: AMI code refactoring 2020-06-24 22:10:19 +01:00
2a955ad949 AMI: deprecated directAMI - use nearestFaceAMI instead 2020-06-24 22:10:19 +01:00
3cd4bc9c09 ENH: mapNearestAMI - re-written to use tree search instead of advancing front 2020-06-24 22:10:18 +01:00
c357d7a760 ENH: AMI: refactored parallel handling to be local to the AMI method 2020-06-24 22:10:18 +01:00
a13e00b5c4 ENH: AMI - multiple updates
- start of work to create a 1-to-1 face mapping across AMI patches
- faces are inserted according to the AMI addressing based on Horacio's method
- removed 'updated' flag and reworked some demand driven updates
- updated to handle 'walking' through baffles
- use bitSet instead of boolList
- moved update of meshPhi to movePoints() functions at fvPatch level
- moved scaling of areas to movePoints() functions at fvPatch level
- rehomed topology change code to own file
- added warning re: geometry construction

ACMI
- split srcMask into srcMask and srcAreaMask
  - former in range 0-1, and latter has bounding or tol to (1-tol) to avoid
    sigFpe's
2020-06-24 22:10:18 +01:00
b61dd6fd51 DOC: update note about Thermo problems with Clang - fixed in clang-10 2020-06-24 18:10:37 +02:00
01f8ea9dd5 CONFIG: update Fujitsu rules (#1671)
- openmp using the libfjomp

- fastmath as per the ArmClang compiler
2020-06-24 18:04:01 +02:00
78fe186727 SUBMODULE: release candidates for external-solver 2020-06-24 16:10:51 +02:00
37895095d7 ENH: also support --prefix for AllwmakeParseArguments
- corresponds to general conventions/expectations
2020-06-24 16:10:41 +02:00
c3f2a01fc9 STYLE: use range-for when iterating labelHashSet 2020-06-24 11:06:54 +02:00
f6deaeef33 STYLE: formatting, remove unused file(s) 2020-06-24 10:51:03 +02:00
ca540320df BUG: Correcting htc definition to avoid negative values 2020-06-23 08:19:54 -07:00
cbcc87549e CONFIG: support openfoam -init=FILE
- useful for supporting a variety of different predefined
  configuration files. Bypasses the regular etc/bashrc entirely.

- minor refactoring in foamCreateModuleInclude
2020-06-23 15:35:52 +02:00
31bbca3c38 DOC: misc updates to doc files 2020-06-23 10:18:32 +02:00
c32f59e268 COMP: fix dlLibraryTable InfoProxy output (older gcc) 2020-06-23 09:09:06 +02:00
65d2394bb9 BUG: windows IOobject::path() incorrect from absolute (fixes #1738)
- only checked if it started with '/' and not 'd:/' (for example).
2020-06-22 14:27:12 +02:00
15d6febeff COMP: chtMultiRegion: avoid excess unused references. See #1726. 2020-06-22 11:55:08 +01:00
676a904c99 BUG: flipped cellZones compat setting for foamToEnsight (#1579)
STYLE: reword text for -excludePatches
2020-06-22 11:19:34 +02:00
8526e44884 ENH: dlLibraryTable InfoProxy output (#1735) 2020-06-22 10:22:45 +02:00
5b6969fce3 TUT: fluxSummary surfaces as list (inadvertently changed in 5982a1aa) 2020-06-22 08:44:46 +02:00
80a4d53885 SUBMODULE: release candidates for avalanche, external-solver 2020-06-19 13:22:28 +02:00
7065593b3f BUG: regression in fluxSummary cellZoneAndDirection (fixes #1736)
- related to change c3571b7357 (does not affect 1912 or older).

  Remnant check for data() should have used valid() method instead.

TUT: add fluxSummary cellZoneAndDirection to angledDuct/implicit
2020-06-19 12:52:00 +02:00
2dcbc09b3e ENH: add foamHasLibrary to test for availability of libraries (#1735)
- For some cases it can be helpful to test if additional libraries can
  be properly resolved.

  This can be useful in scripts to test for additional capability:

      if foamHasLibrary geometricVoF
      then ...
      fi

  But also directly from the command-line to help resolve configuration
  issues:

      foamHasLibrary -verbose petscFoam

  Could not load "petscFoam"
  libpetsc.so.3.13: cannot open shared object file: No such file or directory
2020-06-19 12:52:00 +02:00
420be3f9ab CONFIG: improve handling of in-source PETSC installations
- when installed in-source, use PETSC_ARCH to find additional include
  directory and the correct library directory

CONFIG: bump to new hypre version

- add -hint option for have_adios2, have_hypre, have_petsc
2020-06-19 12:44:14 +02:00
6194548871 ENH: split off modules/list-modules script
STYLE: string quoting when echoing paths in wmake have_* scripts

STYLE: more consistency in foamRunTutorials, foamCleanTutorials options
2020-06-19 12:43:33 +02:00
a4864eb1a8 TUT: relocate flange.ans -> tutorials/resources/geometry
- makes it easier to copy/duplicate the case
2020-06-19 10:09:09 +02:00
86cd5400ce Merge branch 'bug-GL1732' into 'develop'
BUG: provide setup backward-compat for actuationDiskSourceCoeffs

See merge request Development/openfoam!372
2020-06-18 21:59:49 +01:00
0445b00e02 BUG: provide setup backward-compat for actuationDiskSourceCoeffs (#1732) 2020-06-18 21:59:25 +01:00
c7584e1a92 Merge branch 'gitlab-issues.kbc' into 'develop'
ENH: prevent natural-logarithm domain errors in nut wall functions

See merge request Development/openfoam!371
2020-06-18 21:57:06 +01:00
7668f381c8 ENH: prevent natural-logarithm domain errors in nut wall functions (#1730) 2020-06-18 21:56:59 +01:00
d576ab6e6f Merge branch 'feature-curle-fo' into 'develop'
ENH: Updated Curle function object

See merge request Development/openfoam!373
2020-06-18 21:56:16 +01:00
7d4cdc4f8c TUT: Updated vortexShed case wrt latest Curle FO updates 2020-06-18 21:55:44 +01:00
1251b82175 ENH: ensightSurfaceReader updates re: replacing file name masks 2020-06-18 21:55:44 +01:00
ceed53775d ENH: Updated Curle function object
The function object now computes the acoustic pressure at a list of user
specified locations, or from the face centres of a user-supplied surface.
When operating on an input surface, the output can be written back to the
surface or as a list of point values.

Example of function object specification:

    Curle1
    {
        type            Curle;
        libs            ("libfieldFunctionObjects.so");
        ...
        patches         (surface1 surface2);
        c0              330;

        // Input - either points or surface

        input           points;
        observerPositions ((0 0 0)(1 0 0));

        //input           surface;
        //surface         "inputSurface.obj"

        // Output - either points or surface
        output          points;

        //output          surface;
        //surfaceType     ensight;
    }

    Where the entries comprise:
        Property     | Description                  | Required | Default value
        type         | Type name: Curle             | yes      |
        p            | Pressure field name          | no       | p
        patches      | Sound generation patch names | yes      |
        c0           | Reference speed of sound     | yes      |
        input        | Input type                   | yes      |
        observerPositions | List of observer positions (x y z) | no      |
        surface      | Input surface file name      | no       |
        output       | Output type                  | yes      |
        surfaceType  | Output surface type          | no       |
2020-06-18 21:55:44 +01:00
9e311151e3 CONFIG: bump API to 2006 (pre-release) 2020-06-17 16:39:40 +02:00
e8e36db320 Merge branch 'feature-fsi-lbf' into 'develop'
lumped point motion using local linear basic functions (#1341)

See merge request Development/openfoam!271
2020-06-17 15:15:50 +01:00
7db868b509 TUT: bridge using external lumped point motion (#1341)
- see its accompanying README for additional setup instructions
2020-06-17 15:16:27 +02:00
b0136d835e ENH: lumped point motion using local linear basic functions (#1341)
- the earlier implementation of externally controlled lumped point
  motion (see merge request !120 and OpenFOAM-v1706 release notes) was
  conceived for the motion of simple structures such as buildings or
  simple beams. The motion controller was simply defined in terms of
  an orientation axis and divisions along that axis.

  To include complex structures, multiple motion controllers are
  defined in terms of support points and connectivity.

  The points can have additional node Ids associated with them, which
  makes it easier to map to/from FEA models.

  OLD system/lumpedPointMovement specification
  --------------------------------------------

      //- Reference axis for the locations
      axis            (0 0 1);

      //- Locations of the lumped points
      locations       (0 0.05 .. 0.5);

  NEW system/lumpedPointMovement specification
  --------------------------------------------

      // Locations of the lumped points
      points
      (
          (0  0  0.00)
          (0  0  0.05)
          ...
          (0  0  0.50)
      );

      //- Connectivity for motion controllers
      controllers
      {
          vertical
          {
              pointLabels (0 1 2 3 4 5 6 7 8 9 10);
          }
      }

  And the controller(s) must be associated with the given
  pointDisplacement patch. Eg,

     somePatch
     {
         type            lumpedPointDisplacement;
         value           uniform (0 0 0);
         controllers     ( vertical );   // <-- NEW
     }

TUT: adjust building motion tutorial

- use new controllor definitions
- replace building response file with executable
- add updateControl in dynamicMeshDict for slowly moving structure
2020-06-17 15:16:27 +02:00
17ea2c544d TUT: include geometricVoF library for interface sampling 2020-06-17 10:55:24 +02:00
01ec92fd35 GIT: remove leading/trailing blank lines, trailing whitespace 2020-06-17 10:46:26 +02:00
5982a1aab4 STYLE: update tutorials
- use simpler decomposeParDict in tutorials, several had old
  'boilerplate' decomposeParDict

- use simpler libs () format

- update surface sampling to use dictionary format
2020-06-17 10:11:33 +02:00
5225697542 GIT: add missing function object examples for MachNo, log, pow 2020-06-17 08:54:05 +01:00
bcb6e834f8 SUBMODULE: release candidates for avalanche, external-solver 2020-06-17 00:15:22 +02:00
b1182ee8c2 DOC: update modules/README.md and Cross-Compile-mingw information
COMP: provide modules/Allwmake script

- unified entry point with -prefix=... handling (#1721)
2020-06-17 00:01:22 +02:00
c1c995d3fe COMP: fix some linkage issues for mingw
COMP: automatically add FlexLexer.h to MSwindows OSspecific

- useful, frequently forgotten step for cross-compiling
2020-06-16 23:56:41 +02:00
ddfe9ae2a3 COMP: adjustments for SPDP, int64 2020-06-16 21:30:12 +02:00
5adb11f3d3 Merge branch 'release-corrections.kbc' into 'develop'
DOC-STYLE: various release changes

See merge request Development/openfoam!370
2020-06-16 13:50:22 +01:00
4d295c84a0 DOC-STYLE: various release changes 2020-06-16 10:51:44 +01:00
39c2f16eca DOC: add note about openmpi versions, update Requirements 2020-06-15 17:32:49 +02:00
458cec60b1 ENH: support time-varying Tref for externalCoupledTemperature (#1729) 2020-06-15 15:41:05 +02:00
c21c5e070a COMP: relocate compressibleInterIsoFoam (#1726)
- place under compressibleInterFoam to ensure that the library
  dependency on VoFphaseCompressibleTurbulenceModels is satisfied
2020-06-15 14:16:52 +02:00
8b191109b3 COMP: default copy construct for MatrixBlock 2020-06-15 12:39:41 +02:00
e83145ce2b SUBMODULE: (final) release candidate for OpenQBMM 2020-06-15 12:04:33 +02:00
a32ee1b406 COMP: adjust build order for sampling
- build prior to transportModels, which includes geometricVoF and its
  own form of surface sampling (interface sampling)
2020-06-15 11:56:19 +02:00
7dab7f91d8 STYLE: update comments for DynamicList 2020-06-15 11:42:48 +02:00
9b9a070b82 Merge branch 'feature-adjoint-updates' into 'develop'
Updates for the adjoint optimisation library

See merge request Development/openfoam!368
2020-06-12 15:04:48 +01:00
d6104bd497 INT: Minor integration updates 2020-06-12 15:01:09 +01:00
c344520474 TUT: updated/cleaned the optimisation tutorials
- Removed some unnecessary dynamicMeshDicts.
- Removed the writeActiveDesignVariables execution from the Allrun
  scripts, since it is no longer necessary to execute it before
  adjointOptimisationFoam.
- Updated the entries in dynamicMeshDict according to efbc9fc99.
2020-06-12 13:27:55 +01:00
1404b5ffe0 ENH: Homogenised the dynamicMeshDict entries for NURBS3DVolume
(old keywords are still valid, throwing a compatibility warning)

- using (U,V,W) instead of (X1,X2,X3)
- using confine instead of bound
2020-06-12 13:27:55 +01:00
6ee7bc66c5 ENH: added a general framework for normalization and setting targets
for all objective functions.

- The normalization is useful for practically all update methods dealing
with constraints (e.g. SQP, MMA). The normalization factor can be either
given explicitly or, if not given, will be the value of the objective
function in the first optimisation cycle.
- The target value is useful when using the objective as a constraint in
constrained optimisation problems (e.g. drag - dragTarget). It should
only be used with update methods that understand the value of the
constraint (e.g. SQP, MMA) but not when the objective in hand is the
only objective of the optimisation problem. In such a case, a squared
objective should be used (e.g. sqr(drag - dragTarget))
2020-06-12 13:27:55 +01:00
4d67819a2c ENH: changes related to when the objective value is written
- Objective now inherits from localIOdictionary and writes the mean
objective value under the uniform folder, each time mesh.write() is
called. This is crucial for getting the correct old merit function value
if the simulation is continued from a previous state and lineSearch is
used.
- Objectives are now computed and written even if the corresponding
adjoint solver is inactive. This, among others, is also essential for
getting the correct old merit function value in case of continuation.
- Writing of the objective function (and its mean, if present) history
has now moved to updatePrimalBasedQuantities, instead of the preLoop
part of the adjoint solvers. This was decided to get the objective
values to files, even if the adjoint solver is inactive. Arguably, an
even better place to write the objective functions would be the postLoop
part of the primal solvers, however this might cause multiple writes of
the objective value for the inner iterations of lineSearch, if one is
used.
2020-06-12 13:27:55 +01:00
01dfdc4794 ENH: objective: added function to output a blank line
to be used in separating instantaneous objective values of different
optimisation cycles.
2020-06-12 13:27:55 +01:00
dcc039ce80 ENH: Added the nutSqr surrogate noise objective
which qualitatively quantifies noise through a volume integral of the squared
turbulent viscosity.
2020-06-12 13:27:55 +01:00
ad76df43c3 ENH: refactoring and cleaning of optimisationType
Moved part common to all derived classes (e.g. update) to the base
class to avoid code duplication. Practically, only the protected
updateDesignVariables has to be overwritten in each derived class now.
steadyOptimisation was also affected in a minor way.
2020-06-12 13:27:54 +01:00
1eaa54ed2c ENH: Added optional suffix to the file names
holding the sensitivity maps
2020-06-12 13:27:54 +01:00
2048959bb4 ENH: volBSplinesBase: added function returning box ID
given a global control point ID
2020-06-12 13:27:54 +01:00
7192cc924c ENH: added function just returning the sensitivities
without recomputing them. Use with caution!
2020-06-12 13:27:54 +01:00
36b0c5ce15 ENH: changes in SIBase and derived classes
- Added function returning the underlaying surface sensitivities
- Added boolean to control whether to write the underlaying sensitivity
  map (defaults to false)
2020-06-12 13:27:54 +01:00
d5c8dd52bb ENH: introduced an incompressible::shapeSensitivities class
Encapsulates all terms that are common in both E(SI) and FI
formulations, like direct sensitivities and sensitivities due to
primal boundary conditions. Added the latter to all derived sensitivity
types, except for sensitivity maps.
2020-06-12 13:27:53 +01:00
0d9421c6a8 ENH: added the adjointRotatingWallVelocity boundary condition
Same as adjointWallVelocity but also returns the contribution
of the differentiation of the rotatingWallVelocity BC wrt the
face centres, to be added to the sensitivity derivatives.
2020-06-12 13:27:53 +01:00
d3938a79f4 ENH: made adjointBoundaryCondition templated
Main reason was the insertion of a templated virtual function
returning the contribution of the differentiation of the primal
boundary condition, in the case the latter directly depends on a
a geometric quantity (e.g. rotatingWallVelocity).
2020-06-12 13:27:52 +01:00
f21d0ea31e ENH: New cloud function object to remove parcels at face zones
Example usage:

    removeParcels1
    {
        type            removeParcels;
        log             yes;
        resetOnWrite    no;
        resetOnStart    no;
        faceZones       (cycLeft cycRight);
    }

Number and mass of particles removed are written to file
2020-06-12 10:40:52 +01:00
01221babfc TUT: Corrected link in README - fixes #1698 2020-06-12 10:03:12 +01:00
98a9cde998 ENH: fieldAverage - protect against numerical error when determining the next periodic restart 2020-06-12 09:55:52 +01:00
ffa7bfb4f5 TUT: Setting up tutorials for change on planeImplicit function 2020-06-11 12:54:57 -07:00
c712abad09 COMP: Taking out sampledInterface FO from sampling lib and adding it
to geometricVoF

sampledInterface was linked to interfaceProperties thorugh geometricVoF,
and interfaceProperties created a conflict on surfaceTension table
when linked in the reactingEuler solvers by the sampling lib
2020-06-11 12:54:56 -07:00
ffe07039e0 ENH: boundaryData: prefer output with header. See #1640. 2020-06-11 16:01:42 +01:00
1666180271 STYLE: directionalMeshWave: input renaming. 2020-06-11 15:39:25 +01:00
14e561d212 Merge branch 'feature-weber-number' into 'develop'
New Weber number cloud function object

See merge request Development/openfoam!369
2020-06-11 15:00:36 +01:00
ee94720594 ENH: Cloud function objects - added Weber number calcuation and output
Example usage:

    cloudFunctions
    {
        WeberNumber1
        {
            type    WeberNumber;
        }
    }

This will calculate and write the Weber number field as a 'standard'
cloud field, available for post-processing alongside other lagrangian
fields in the lagrangian/<cloudName> directory.
2020-06-11 14:56:46 +01:00
13fa1b0517 ENH: Cloud function objects - pass trackingData into pre|post evolve functions
Might also consider passing through the remaining hooks, e.g. for postMove,
postPatch, postFace etc
2020-06-11 14:56:46 +01:00
5c3059d218 Merge branch 'misc.0620.kbc' into 'develop'
ENH: Miscellaneous enhancement/features and bug fixes

See merge request Development/openfoam!364
2020-06-11 13:30:35 +01:00
60809c3f50 ENH: simplify turbulentDigitalFilterInlet BC 2020-06-11 13:30:30 +01:00
4a798b9ea5 ENH: add new 'pow' FO 2020-06-11 13:30:30 +01:00
2803f765f5 BUG: decomposePar -decomposeParDict option (fixes #1649)
DOC: reorder the options of decomposePar in the header file
2020-06-11 13:30:30 +01:00
8a188a1fd6 ENH-DOC: fix inconsistent Cmu lookup (fixes #647) 2020-06-11 13:30:30 +01:00
d0d3670d01 ENH: add missing/improve annotated dictionaries
New:
  - blockMeshDict
  - sampleDict
  - boxTurbDict
  - createBoxTurbDict
  - dsmcInitialiseDict
  - mdEquilibrationDict
  - mdInitialiseDict
  - obstaclesDict
  - optimisationDict
  - potentialDict
  - probesDict
  - sampleDict
  - setExprBoundaryFieldsDict
  - setExprFieldsDict

  Improved:
  - extrudeMeshDict
  - topoSetSourcesDict
2020-06-11 13:30:29 +01:00
5cbdb7a3d7 INT: various integrations from openfoam.org
ENH: add log FO
  ENH: improve log with scale, and offset entries
  BUG: ensure extrueMesh does not fail in parallel with wedge extrusion
  BUG: add missing clone and mapping funcs to copiedFixedValue, fixedMultiPhaseHeatFlux
  ENH: meshToMesh0::cellAddressing slight speed up for some geometries
  BUG:0003495: Divide-by-zero in SHF particle break-up model
  BUG:0003492: The formula in the OF is inconsistent with the Rosin-Rammler distribution theory formula
2020-06-11 13:30:29 +01:00
5bf440956a ENH: timeVaryingMapped: abstract IFstream/regIOobject handling. See #1640.
This change abstracts out the reading of "boundaryData". It should
now support OpenFOAM headers and with that also binary input.
2020-06-11 12:00:51 +01:00
30ea38a77e ENH: shanppyHexMesh: disable gap detection on same surface. See #1463. 2020-06-10 15:36:33 +01:00
34ee7b0b95 STYLE: use .template instead of .temp for tutorial template files
- avoids possible confusion with temporary files
2020-06-10 15:29:08 +02:00
0712beb21a ENH: relocate some PDRsetFields internals into library 2020-06-10 15:29:08 +02:00
8cf346a9c5 ENH: PDRsetFields adjustments
- missing minThreshold in activePressureForceBaffleVelocity

- update names of cyclics

- increase tolerance for zero-thickness baffles

- velocity field "U" instead of "UBet"

- viscosity field "nut" instead of "mut"
2020-06-10 15:29:07 +02:00
b6a953cfc9 STYLE: writeEntry instead of writeKeyword / END_STATEMENT pair 2020-06-10 15:29:07 +02:00
5a6f54f24b COMP: use files() method name in interfaceHeight function object
- avoid warnings about masked method names
2020-06-10 15:29:07 +02:00
b89e1f025c ENH: portable scoping char for fieldCoordinateSystemTransform (fixes #1675)
- replace ':' scoping with IOobject::scopedName(), which automatically
  uses '_' for Windows compilations where the ':' is a meta-character
  (drive separator)

- apply similar local change for the momentum function object.

*** This topic will be revisited in the future ***
2020-06-10 15:29:07 +02:00
b87dd8147a ENH: add moveMesh -deltaT option
- overrides normal deltaT for testing accelerated motion.

  Can be useful to test mesh motions with constant/dynamicMeshDict
  entries (updateControl, updateInterval) where the mesh motion is
  much slower than any of the fluid physics.

  see commit 87bba9ae14
2020-06-10 15:29:07 +02:00
076bcc25c9 ENH: relocate externalFileCoupler from finiteVolume to meshTools 2020-06-10 15:29:07 +02:00
e2ad9f08a8 COMP: Resolved compiler warning messages 2020-06-10 14:27:01 +01:00
6a8dab0011 STYLE: tutorials: load in additional models. See #1726. 2020-06-10 12:56:55 +01:00
003ec000e0 COMP: max: add explicit type. See #1726. 2020-06-10 12:21:00 +01:00
aa956f4b05 ENH: Pstream: Feed through outstanding requests more. See #1626.
This e.g. was giving a problem with using volPointInterpolation (in
functionObjects) with non-blocking global reductions.
2020-06-10 12:10:02 +01:00
ff568aa67f Merge branch 'feature-wall-functions' into 'develop'
ENH: New wall-function blending approaches

See merge request Development/openfoam!350
2020-06-10 10:24:25 +01:00
07a5babdde ENH: add wall-function blending treatments
Please see the Extended Code Guide and header files for the details.

    ENH: add wall-function blending treatments to epsilonWallFunc
         adds `stepwise`, `max`, `binomial`, and `exponential` wall-function
         blending treatments:
    COMP: check backward compatibility for:
          `serial`
          `parallel`
          `serial restart`
          `parallel restart`
          computations in comparison to the following tutorials from v1906:
          `circuitBoardCooling  condensatingVessel  evaporationMultiComponent
           hotRoom  movingBox  multiRegionHeaterRadiation  reverseBurner
           solidQuenching2D`
    STYLE: simplify `forAll`s

    ENH: add new wall blending approaches into omegaWallFunction
         adds stepwise, max, binomial, and exponential wall function blending apprs.
         ensures/forces the backward compatibility:
           - blended = true    (blending:BINOMIAL2) (default)
           - blended = false   (blending:STEPWISE)
        simplifies forAlls
        deprecates objects:
           - "blended" - use "blending::" options
           - "includeG" - as was hardcoded

    ENH: add wall-func blending treatments into nutWallFuncs
    - nutWallFunction
    - nutUWallFunction
    - nutkWallFunction
    COMP: check backward compatibility for:
          - serial
          - parallel
          - serial restart
          - parallel restart
          computations in comparison to the following tutorials from v1906:
          - heatTransfer/buoyantSimpleFoam/buoyantCavity
          - compressible/rhoSimpleFoam/gasMixing/injectorPipe

    DOC: modify header docs in wallFuncs
    - nutUTabulatedWallFunction
    - nutUSpaldingWallFunction
    - nutURoughWallFunction
    - nutUBlendedWallFunction
      - REVERT: change write order
    - nutLowReWallFunction
    - kLowReWallFunction:
      - ENH: protect against zero-division error through 'Ceps2' entry
      - STYLE: remove few redundant empty lines
2020-06-10 10:09:31 +01:00
324e85a9c9 Merge branch 'feature-atmospheric-boundary-layer-model-suite' into 'develop'
ENH: New atmospheric boundary layer (ABL) model suite (Part 1)

See merge request Development/openfoam!363
2020-06-09 11:09:10 +01:00
41e264f27d ENH: New atmospheric boundary layer (ABL) model suite (Part 1)
Please refer to the header file documentation for complete set of details.

  ENH: add new fvOptions for ABL modelling

    - atmAmbientTurbSource
    - atmBuoyancyTurbSource
    - atmCoriolisUSource
    - atmLengthScaleTurbSource
    - atmPlantCanopyTurbSource
    - atmPlantCanopyUSource
    - atmPlantCanopyTSource
    - atmNutSource

  ENH: add new boundary conditions for ABL modelling
       with PatchFunction1 and TimeFunction1 support

    - atmAlphatkWallFunction
    - atmEpsilonWallFunction
    - atmNutkWallFunction
    - atmNutUWallFunction
    - atmNutWallFunction
    - atmOmegaWallFunction
    - atmTurbulentHeatFluxTemperature

  STYLE: change names of nutkAtmRoughWallFunction -> atmNutkWallFunction by
         ensuring the bitwise backward compatibility

  ENH: add new variable-scaling force computation method to actuationDiskSource

  ENH: review actuationDiskSource and radialActuationDiskSource

  ENH: add new function object, ObukhovLength

  ENH: add new ABL tutorials/verifications

    - verificationAndValidation/atmosphericModels/atmFlatTerrain
      - verification with the Leipzig field experiment
      - illustration of precursor/successor field mapping
    - verificationAndValidation/atmosphericModels/atmForestStability
      - verification with the Sweden field experiment
    - update incompressible/simpleFoam/turbineSiting
2020-06-09 11:08:14 +01:00
70cd6c6176 Merge branch 'integration-vof-library' into 'develop'
CONT: Addition of compressibleIsoInterFoam and PLIC

See merge request Development/openfoam!349
2020-06-09 08:15:54 +01:00
3c131d8504 TUT: new/updated for compressibleInterIsoFoam 2020-06-09 08:11:04 +01:00
44a84d4778 CONT: Addition of compressibleIsoInterFOam and PLIC
1) Implementation of the compressibleIsoInterFOam solver
   2) Implementation of a new PLIC interpolation scheme.
   3) New tutorials associated with the solvers

This implementation was carried out by Henning Scheufler (DLR) and Johan
Roenby (DHI), following :

\verbatim

Henning Scheufler, Johan Roenby,
Accurate and efficient surface reconstruction from volume fraction data
on general meshes, Journal of Computational Physics, 2019, doi
10.1016/j.jcp.2019.01.009

\endverbatim

The integration of the code was carried out by Andy Heather and Sergio
Ferraris from OpenCFD Ltd.
2020-06-09 08:11:04 +01:00
237f2e1076 STYLE: accept label for version in dictionary header
- refinement of commit 33f9ae5080.

  After foamDictionary -expand, the '2.0' becomes '2', so accept that
  as a reasonable token.
2020-06-09 00:55:58 +02:00
51db3c85a7 ENH: add canCompile test to RunFunctions
- allow conditional skipping of tutorials (for example) if wmake or
  the expected compiler is not available
2020-06-09 00:55:58 +02:00
b2467ff442 STYLE: minor code style changes 2020-06-09 00:55:01 +02:00
f5874937eb ENH: copy assignment, bool comparison for polynomialFunction 2020-06-08 21:33:31 +02:00
087e963af5 STY: Changing AUTO_WRITE flags in mass exchange models 2020-06-08 12:22:24 -07:00
1397b59dc2 TUT: Adding CodeField example in tutorial 2020-06-08 12:22:24 -07:00
9d1f39165b GIT: remove merge/rebase artifacts 2020-06-08 16:39:17 +01:00
2c751d2ad3 Merge branch 'doc.topoSet' into 'develop'
DOC: Elaborate the usage of topoSet

See merge request Development/openfoam!361
2020-06-08 15:52:11 +01:00
3bf15d1b33 DOC: elaborate the usage of topoSet
TUT: add topoSet examples to pisoFoam/RAS/cavity tutorial
  BUG: fixes #1673
2020-06-08 15:46:18 +01:00
2c827fdf99 Merge branch 'doc-FOs-part-1' into 'develop'
DOC: Elaborate the usage of function objects

See merge request Development/openfoam!348
2020-06-08 15:44:33 +01:00
a5c6516e23 DOC: elaborate the usage of function objects
ENH: update libs of etc/caseDicts/postProcess items
  ENH: ensure destructor=default
  ENH: ensure constness
  ENH: ensure no 'copy construct' and 'no copy assignment' exist
  TUT: add examples of function objects with full set
       of settings into a TUT if unavailable
  TUT: update pisoFoam/RAS/cavity tutorial in terms of usage
2020-06-08 15:43:47 +01:00
b549116588 Merge branch 'code-review.saf' into 'develop'
Adding PIMPLE option finalOnLastPimpleIterOnly

See merge request Development/openfoam!365
2020-06-08 15:42:53 +01:00
775fe1d596 ENH: Adding finalOnLastPimpleIterOnly to allow Final solver in PIMPLE
The PIMPLE option finalOnLastPimpleIterOnly allows the call the Final
solver only in the last PIMPLE loop. The default is false which is
the present behavior.
2020-06-08 15:42:52 +01:00
95c675428d SUBMODULE: update modules prefix handling (see #1721) 2020-06-08 15:57:04 +02:00
15e2384d51 SUBMODULE: added external-solver PETSc submodule 2020-06-08 15:57:03 +02:00
5d364f886a BUG: swallowed -fromWmake argument 934d0bd743
- should pass onwards to other Allwmake scripts
2020-06-08 15:57:03 +02:00
8a27989cbf ENH: Added support for internal vol fields 2020-06-08 13:59:46 +01:00
4032ab5e15 DOC: waveMaker - removed references to unused x0 input parameter 2020-06-08 13:59:46 +01:00
53767fc8ce Merge branch 'feature-flexible-install-paths' into 'develop'
Feature flexible install paths

See merge request Development/openfoam!366
2020-06-08 13:50:46 +01:00
934d0bd743 ENH: support FOAM_MODULE_PREFIX to guide location of module builds (#1721)
- When compiling additional modules or user code, we need more control
  for the installation locations beyond the usual FOAM_USER_LIBBIN,
  FOAM_SITE_LIBBIN, FOAM_LIBBIN, and wish to have these values be
  modifiable without editing files.

- provide wmake rules for handling standard defaults:
    * GENERAL_RULES/module-path-user
    * GENERAL_RULES/module-path-group
    * GENERAL_RULES/module-path-project
  which are incorporated as follows:

  Make/options:
      include $(GENERAL_RULES)/module-path-user

  Make/files:
      LIB = $(FOAM_MODULE_LIBBIN)/libMyLibrary

  By default these would compile into FOAM_USER_{APPBIN,LIBBIN} but
  could be adjusted at compilation time. For example,

```
wmake -module-prefix=/path/my-install-location
```
Or
```
./Allwmake -module-prefix=/path/my-install-location
./Allwmake -prefix=/path/my-install-location
```
Or
```
FOAM_MODULE_PREFIX=/path/my-install-location ./Allwmake
```

ENH: add -no-recursion option for AllwmakeParseArguments

- more descriptive naming than the -fromWmake option (still supported)

- remove wmake/scripts/wmake.{cmake,wmake}-args since the -prefix
  handling and -no-recursion is now directly handled by AllwmakeParseArguments
2020-06-08 13:51:26 +02:00
0f27a540be COMP: initialization order 2020-06-08 12:47:43 +02:00
8e0b05368f CONFIG: add gcc 10 series, reorder the compiler version list
- now list compiler versions in reverse order (newest first) similar
  to how they are listed on the gcc/llvm sites. Add comments to
  mention which compiler series are now considered unsupported.
2020-06-08 11:41:08 +02:00
636d2688a5 COMP: corrected code removed in 51c2329f97 2020-06-08 08:07:34 +01:00
bcc1a49937 TUT: add parallel test for laplacianFoam
- one of the simplest test applications to run quickly and test
2020-06-05 17:54:42 +02:00
bb2ae5c90d GIT: remove merge/rebase artifacts 2020-06-05 17:01:27 +02:00
f6bd56ddae STYLE: some tests built into FOAM_APPBIN (should be FOAM_USER_APPBIN) 2020-06-05 16:34:51 +02:00
ba8f1265e1 CONFIG: update boost, cgal, openmpi versions (#1705)
- the CGAL version change is associated with a header-only build
  (needs updated ThirdParty scripts).

- openmpi is a major version change (4.0.3)
2020-06-05 16:28:01 +02:00
538dfcd6d3 Merge branch 'feature-atmInletBCs' into 'develop'
ENH: Improve and verify atmBoundaryLayerInlet conditions

See merge request Development/openfoam!354
2020-06-05 14:42:23 +01:00
336fb3bddf ENH: improve/verify atmBoundaryLayerInlet conditions
ENH: add generalised log-law type ground-normal inflow boundary conditions for
  wind velocity and turbulence quantities for homogeneous, two-dimensional,
  dry-air, equilibrium and neutral atmospheric boundary layer (ABL) modelling

  ENH: remove `zGround` entry, which is now automatically computed

  ENH: add `displacement height` entry, `d`

  ENH: add generalised atmBoundaryLayerInletOmega boundary condition

  ENH: add a verification case for atmBoundaryLayerInlet BCs

  DOC: improve atmBoundaryLayerInlet header documentation

  BUG: fix value-entry behaviour in atmBoundaryLayerInlet (fixes #1578)
  Without this change:
  - for serial-parallel computations, if `value` entry is available in
    an `atmBoundaryLayerInlet` BC, the theoretical ABL profile expressions
    are not computed, and the `value` entry content is used as a profile data
  - for parallel computations, if `value` entry is not available, `decomposePar`
    could not be executed.
  With this change:
  - assuming `value` entry is always be present, the use of `value` entry for
    the ABL profile specification is determined by a flag `initABL`
  - the default value of the optional flag `initABL` is `true`, but whenever
    `initABL=true` is executed, `initABL` is overwritten as `false` for the
    subsequent runs, so that `value` entry can be safely used.
  Thanks Per Jørgensen for the bug report.

  BUG: ensure atmBoundaryInlet conditions are Galilean-invariant (fixes #1692)

  Related references:

      The ground-normal profile expressions (tag:RH):
        Richards, P. J., & Hoxey, R. P. (1993).
        Appropriate boundary conditions for computational wind
        engineering models using the k-ε turbulence model.
        In Computational Wind Engineering 1 (pp. 145-153).
        DOI:10.1016/B978-0-444-81688-7.50018-8

    Modifications to preserve the profiles downstream (tag:HW):
        Hargreaves, D. M., & Wright, N. G. (2007).
        On the use of the k–ε model in commercial CFD software
        to model the neutral atmospheric boundary layer.
        Journal of wind engineering and
        industrial aerodynamics, 95(5), 355-369.
        DOI:10.1016/j.jweia.2006.08.002

    Expression generalisations to allow height
    variation for turbulence quantities (tag:YGCJ):
        Yang, Y., Gu, M., Chen, S., & Jin, X. (2009).
        New inflow boundary conditions for modelling the neutral equilibrium
        atmospheric boundary layer in computational wind engineering.
        J. of Wind Engineering and Industrial Aerodynamics, 97(2), 88-95.
        DOI:10.1016/j.jweia.2008.12.001

    The generalised ground-normal profile expression for omega (tag:YGJ):
        Yang, Y., Gu, M., & Jin, X., (2009).
        New inflow boundary conditions for modelling the
        neutral equilibrium atmospheric boundary layer in SST k-ω model.
        In: The Seventh Asia-Pacific Conference on Wind Engineering,
        November 8-12, Taipei, Taiwan.

  Reproduced benchmark:
      Rectangular prism shown in FIG 1 of
        Hargreaves, D. M., & Wright, N. G. (2007).
        On the use of the k–ε model in commercial CFD software
        to model the neutral atmospheric boundary layer.
        Journal of wind engineering and
        industrial aerodynamics, 95(5), 355-369.
        DOI:10.1016/j.jweia.2006.08.002
  Benchmark data:
      HW, 2007 FIG 6

  TUT: update simpleFoam/turbineSiting tutorial accordingly
2020-06-05 14:40:53 +01:00
5863c94be0 Merge branch 'issue-1556-fo-header-writing' into 'develop'
ENH: enable user to control re-writing of function object output file headers.  See #1556

See merge request Development/openfoam!360
2020-06-05 14:38:15 +01:00
1b45599b26 ENH: enable user to control re-writing of function object output file headers. See #1556 2020-06-05 14:37:21 +01:00
d44babcc78 Merge branch 'feature-iterative-eigendecomposition' into 'develop'
ENH: Robust Iterative Eigendecomposition and Parallel Low-Memory Dynamic Mode Decomposition

See merge request Development/openfoam!353
2020-06-05 14:35:57 +01:00
730233cd15 ENH: add new FO Streaming-Total Dynamic Mode Decomposition (STDMD)
STDMD (i.e. Streaming Total Dynamic Mode Decomposition) is a variant of
    a data-driven dimensionality reduction method.

    STDMD is being used as a mathematical post-processing tool to compute
    a set of dominant modes out of a given flow (or dataset) each of which is
    associated with a constant frequency and decay rate, so that dynamic
    features of a given flow may become interpretable, and tractable.
    Among other Dynamic Mode Decomposition (DMD) variants, STDMD is presumed
    to provide the general DMD method capabilities alongside economised and
    feasible memory and CPU usage.

    Please refer to the header file documentation for further details.

  ENH: add new STDMD tutorial, pimpleFoam/laminar/cylinder2D
2020-06-05 14:35:37 +01:00
ef9ee7a8b1 ENH: add iterative eigen decomposition solver, EigenMatrix
ENH: add Test-EigenMatrix application

  The new iterative eigen decomposition functionality is
  derived from:

    Passalacqua et al.'s OpenQBMM (openqbmm.org/),
    which is mostly derived from JAMA (math.nist.gov/javanumerics/jama/).
2020-06-05 14:35:36 +01:00
153f847ad2 BUG: fix pinv() for single-element input matrices
ENH: return zero-valued matrix when input zero-valued matrix in pinv()
2020-06-05 14:35:36 +01:00
af22163492 ENH: improve Matrix classes and tests 2020-06-05 14:35:36 +01:00
b3e5620d2a COMP: typo in surfaceBooleanFeatures/PolyhedronReader Make/options
ENH: strip {GMP,MPRF}_ARCH_PATH in make rules
2020-06-05 12:36:37 +02:00
1c5508a61b SUBMODULES: updates and revert
- update OpenQBMM to origin/openfoam.com

- revert adios, visualization
  * changes inadvertently crept in recent commit
2020-06-05 11:40:07 +02:00
7618150ea4 ENH: fileModificationSkew: Changed default. See #1472 2020-06-05 09:06:14 +01:00
67b7b378db ENH: motorBike: change coarseLevel solver 2020-06-05 09:06:14 +01:00
5c220a9e2d Merge remote-tracking branch 'origin/master' into develop 2020-06-04 22:30:12 +02:00
fec5093c04 ENH: add blockMesh -write-vtk option
- generates a vtk file in an ASCII, XML format (blockTopology.vtu).

  More information than the equivalent obj file since it includes
  connectivity, cell shapes and cell IDs (equivalent to the block
  numbers).
2020-06-04 22:15:26 +02:00
8f8617a8ca CONFIG: increment patch level 2020-06-04 21:49:35 +02:00
11ff01f434 ENH: refactor vtk::internalWriter, vtk::patchWriter
- new vtk::internalMeshWriter, vtk::patchMeshWriter
  intermediate classes without finiteVolume dependencies.

  Enables direct use with a polyMesh.
  Makes vtk::internalWriter, vtk::patchWriter header/template only.
2020-06-04 21:44:26 +02:00
9d2fe2086a BUG: missing compilation for some vtk conversion components (fixes #1720) 2020-06-04 21:07:44 +02:00
ea4c8f4bea ENH: boolVector for specialized bundling of boolean values
- bundled of boolean values as a vector of 3 components with
  element access using x(), y() and z() member functions.
  It also has some methods similar to bitSet.

- Not derived from Vector or VectorSpace since it does not share very
  many vector-like characteristics.
2020-06-04 16:56:21 +02:00
bc9e97cf36 ENH: additional polynomial constructors, improved I/O
- support construct from initializer_list, which can help simplify
  code with constant coefficients.

- add default constructor for polynomialFunction and Istream reading
  to support resizable lists of polynomialFunction.

  A default constructed polynomialFunction is simply equivalent to
  a constant zero.

- no special IO handling for Polynomial required,
  it is the same as VectorSpace anyhow.
2020-06-04 15:02:21 +02:00
be417c9841 COMP: erroneous return from void method (fixes #1716) 2020-05-26 10:40:26 +02:00
11745 changed files with 256636 additions and 128637 deletions

29
.gitignore vendored
View File

@ -12,7 +12,7 @@
# File-browser settings - anywhere
.directory
# CVS recovered versions - anywhere
# Backup/recovery versions - anywhere
.#*
# Objects and archives - anywhere
@ -23,7 +23,7 @@
# Derived files
lex.yy.c
# Corefiles
# Core dumps
core
# Dependency files - anywhere
@ -47,22 +47,21 @@ platforms/
# Reinstate wmake rules that might look like build directories
!/wmake/rules/*/
# doxygen generated documentation
# Doxygen generated
doc/Doxygen/html
doc/Doxygen/latex
doc/Doxygen/man
doc/Doxygen/DTAGS
# Generated files in the main directory (e.g. ReleaseNotes-?.?.html)
# and in the doc directory
# Generated files in the main and doc directories
/*.html
/doc/*.html
# Untracked configuration files
# Untracked configuration/preferences files
/etc/prefs.csh
/etc/prefs.sh
/etc/config.csh/prefs.csh
/etc/config.sh/prefs.sh
/etc/config.csh/prefs.*
/etc/config.sh/prefs.*
/wmake/rules/General/mplibUSER*
# Source packages - anywhere
@ -73,19 +72,11 @@ doc/Doxygen/DTAGS
*.tgz
*.gtgz
# Ignore the persistent .build tag in the main directory
/.build
# Ignore .timeStamp in the main directory
/.timeStamp
# Ignore .tags in the main directory
/.tags
# Ignore project files in the main directory
# Ignore tags or project files in the main directory
/.cproject
/.project
/.dir-locals.el
/.project
/.tags
# Ignore the test directory
/tutorialsTest

View File

@ -3,7 +3,7 @@
Before opening a new issue, make sure to search for keywords in the issues
filtered by the "bug" label and check to see if it has already been reported
You can see how your report will be rendered on the platform by using the
"preview" tab above
-->

3
.gitmodules vendored
View File

@ -14,3 +14,6 @@
[submodule "visualization"]
path = modules/visualization
url = https://develop.openfoam.com/modules/visualization.git
[submodule "external-solver"]
path = modules/external-solver
url = https://develop.openfoam.com/Modules/external-solver.git

View File

@ -18,7 +18,7 @@ fi
#------------------------------------------------------------------------------
# Preamble. Report tools or at least the mpirun location
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/list_tools ]
then . "$WM_PROJECT_DIR"/wmake/scripts/list_tools
then sh "$WM_PROJECT_DIR"/wmake/scripts/list_tools || true
else
echo "mpirun=$(command -v mpirun || true)"
fi
@ -73,16 +73,13 @@ echo
applications/Allwmake $targetType $*
# Additional components/modules
if [ -d "$WM_PROJECT_DIR/modules" ]
if [ "$FOAM_MODULE_PREFIX" = false ]
then
echo "========================================"
echo "Compile OpenFOAM modules"
echo " ignoring possible compilation errors"
echo " make certain to check the output file"
echo "OpenFOAM modules disabled (prefix=false)"
echo
set +e
export WM_CONTINUE_ON_ERROR=true
elif [ -d "$WM_PROJECT_DIR/modules" ]
then
(cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
fi

56
CONTRIBUTORS.md Normal file
View File

@ -0,0 +1,56 @@
# Contributors to OpenFOAM
The following is an list of known contributors to OpenFOAM.
It is likely incomplete...
## Contributors (alphabetical by surname)
- William Bainbridge
- Gabriel Barajas
- Kutalmis Bercin
- Ivor Clifford
- Greg Collecutt
- Jonathan Cranford
- Sergio Ferraris
- Matej Forman
- Marian Fuchs
- Pawan Ghildiyal
- Chris Greenshields
- Bernhard Gschaider
- Andrew Heather
- David Hill
- Mattijs Janssens
- Andrew Jackson
- Hrvoje Jasak
- Alexander Kabat vel Job
- Thilo Knacke
- Tommaso Lucchini
- Graham Macpherson
- Alexey Matveichev
- Karl Meredith
- Laurence McGlashan
- Timo Niemi
- Haakan Nilsson
- Niklas Nordin
- Mark Olesen
- Victor Olesen
- Evangelos Papoutsis-Kiachagias
- Juho Peltola
- Johan Roenby
- Henrik Rusche
- Bruno Santos
- Henning Scheufler
- Richard Smith
- Prashant Sonakar
- Hilary Spencer
- Gavin Tabor
- Zeljko Tukovic
- Eugene De Villiers
- Yi Wang
- Norbert Weber
- Henry Weller
- Niklas Wikstrom
- Thorsten Zirwes
<!----------------------------------------------------------------------------->

View File

@ -1,4 +1,4 @@
# META-INFO
## META-INFO
Meta-information is generally for OpenFOAM internal use only.
@ -12,7 +12,7 @@ will need to be updated accordingly:
- etc/openfoam
- wmake/scripts/wmake-build-info
## api-info
### api-info
This file and its contents are to be tracked by git.
@ -21,7 +21,7 @@ This file and its contents are to be tracked by git.
- File content (patch) is manually generated content.
## build-info
### build-info
This file is ***never*** to be tracked by git, but may be present in
shipped source archives.
@ -30,9 +30,9 @@ shipped source archives.
git information and cached from previous wmake (api)
## Content types
### Content types
### api
#### api
Format: `date +%y%m`
@ -41,7 +41,7 @@ Format: `date +%y%m`
Example, `1712` for the Dec-2017 release.
### patch
#### patch
Format: `date +%y%m%d`
@ -57,7 +57,7 @@ ascribed too much meaning, but will often correspond to the last
merge with a *maintenance* (*eg*, `master`) branch.
## Flow of information
### Flow of information
Changes in the build information must be reflected in information
available in the final binaries. Conversely, it is necessary for later
@ -76,11 +76,11 @@ the saved information needs synchronization. The command
`wmake -build-info -update` performs the synchronization.
## Notes
### Notes
The saved information is split into two separate files. The `api-info`
contains more permanent information, whereas the `build-info` is more
transient in nature.
----
2020-05-05
2020-06-23

View File

@ -1,2 +1,2 @@
api=2004
patch=200506
api=2012
patch=210210

View File

@ -1,4 +1,4 @@
# About OpenFOAM
## About OpenFOAM
OpenFOAM is a free, open source CFD software [released and developed by OpenCFD Ltd since 2004](http://www.openfoam.com/history/).
It has a large user base across most areas of engineering and science, from both commercial and academic organisations.
OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics.
@ -11,7 +11,7 @@ individual and group contributors, integrations
[governance guided activities](https://www.openfoam.com/governance/).
# Copyright
## Copyright
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@ -22,7 +22,7 @@ description of the GNU General Public License terms under which you
may redistribute files.
# OpenFOAM Trademark
## OpenFOAM Trademark
OpenCFD Ltd grants use of its OpenFOAM trademark by Third Parties on a
licence basis. ESI Group and OpenFOAM Foundation Ltd are currently
@ -35,7 +35,7 @@ any questions on the use of the OpenFOAM trademark.
Violations of the Trademark are monitored, and will be duly prosecuted.
# Using OpenFOAM
## Using OpenFOAM
If OpenFOAM has already been compiled on your system, simply source
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
@ -44,7 +44,7 @@ For example, for the OpenFOAM-v1912 version:
source /installation/path/OpenFOAM-v1912/etc/bashrc
```
# Compiling OpenFOAM
## Compiling OpenFOAM
If you are compiling OpenFOAM from source, please see the relevant
guides:
@ -55,7 +55,7 @@ guides:
| [ThirdParty][repo third] | [readme][link third-readme] | [system requirements][link third-require] | [build][link third-build] |
# How do I know which version I am currently using?
## How do I know which version I am currently using?
The value of the `$WM_PROJECT_DIR` or even `$WM_PROJECT_VERSION` are
not guaranteed to have any correspondence to the OpenFOAM release
@ -110,7 +110,7 @@ patching changes made within the currently active environment and
should be used with caution.
# ThirdParty directory
## ThirdParty directory
OpenFOAM normally ships with a directory of 3rd-party software and
build scripts for some 3rd-party software that is either necessary or
@ -197,13 +197,13 @@ ThirdParty directory will contain either an `Allwmake` file or a
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-common/blob/develop/Requirements.md
# Useful Links
## Useful Links
- Download [source](https://sourceforge.net/projects/openfoam/files/) and [download and installation instructions](http://www.openfoam.com/download/)
- Download [source](https://dl.openfoam.com/source/) and [download and installation instructions](http://www.openfoam.com/download/)
- [Documentation](http://www.openfoam.com/documentation)
- [Reporting bugs/issues/feature requests](http://www.openfoam.com/code/bug-reporting.php)
- [Issue tracker](https://develop.openfoam.com/Development/openfoam/issues)
- [Wiki](http://wiki.openfoam.com/) and [code wiki](https://develop.openfoam.com/Development/openfoam/wikis/)
- [Issue tracker](https://develop.openfoam.com/Development/openfoam/-/issues)
- [Code wiki](https://develop.openfoam.com/Development/openfoam/-/wikis/) and [general wiki](http://wiki.openfoam.com/)
- [Community](http://www.openfoam.com/community/), [Governance](http://www.openfoam.com/governance/)
- [Contacting OpenCFD](http://www.openfoam.com/contact/)

View File

@ -2,7 +2,6 @@
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
. ${WM_PROJECT_DIR:?}/wmake/scripts/have_fftw
#------------------------------------------------------------------------------
if have_fftw

View File

@ -19,4 +19,3 @@
Kmesh K(mesh);
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);

View File

@ -0,0 +1,3 @@
acousticFoam.C
EXE = $(FOAM_APPBIN)/acousticFoam

View File

@ -0,0 +1,14 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fvOption/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lregionFaModels

View File

@ -0,0 +1,99 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
acousticFoam
Group
grpAcousticSolvers
Description
Acoustic solver solving the acoustic pressure wave equation.
\f[
\ddt2{pa} - c^2 \laplacian{pa} = 0
\f]
where
\vartable
c | Sound speed
pa | Acoustic pressure
\endvartable
SourceFiles
acousticFoam.C
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvOptions.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Acoustic solver solving the acoustic pressure wave equation."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createRegionControls.H"
#include "readTransportProperties.H"
#include "createFields.H"
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
while (pimple.correct())
{
#include "paEqn.H"
}
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,15 @@
Info << "\nReading pa" << endl;
volScalarField pa
(
IOobject
(
"pa",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

View File

@ -0,0 +1,8 @@
fvSolution solutionDict(runTime);
const dictionary& pimpleDict = solutionDict.subDict("PIMPLE");
bool solvePrimaryRegion
(
pimpleDict.getOrDefault("solvePrimaryRegion", true)
);

View File

@ -0,0 +1,15 @@
fvScalarMatrix paEqn
(
fvm::d2dt2(pa) - sqr(c0)*fvc::laplacian(pa)
);
if (solvePrimaryRegion)
{
paEqn.relax();
paEqn.solve();
}
else
{
pa.correctBoundaryConditions();
}

View File

@ -0,0 +1,23 @@
Info<< "\nReading transportProperties" << endl;
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dimensionedScalar c0("c0", dimVelocity, transportProperties);
dimensionedScalar rho("rho", dimDensity, transportProperties);
scalar MaxCo =
max(mesh.surfaceInterpolation::deltaCoeffs()*c0).value()
*runTime.deltaT().value();
Info<< "Max acoustic Courant Number = " << MaxCo << endl;

View File

@ -15,7 +15,7 @@
)
: -betav*dpdt
)
- fvm::laplacian(Db, hea)
- fvm::laplacian(DbThermal, hea)
+ betav*fvOptions(rho, hea)
);

View File

@ -16,13 +16,7 @@ if (ign.ignited())
)*rho/thermo.rhou()
: -betav*dpdt*rho/thermo.rhou()
)
- fvm::laplacian(Db, heau)
// These terms cannot be used in partially-premixed combustion due to
// the resultant inconsistency between ft and heau transport.
// A possible solution would be to solve for ftu as well as ft.
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau)
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
- fvm::laplacian(DbThermal, heau)
==
betav*fvOptions(rho, heau)
);

View File

@ -1,33 +1,33 @@
XiModels/XiModel/XiModel.C
XiModels/XiModel/XiModelNew.C
XiModels/fixed/fixed.C
XiModels/algebraic/algebraic.C
XiModels/transport/transport.C
XiModels/transport/transportTwoEqs/transportTwoEqs.C
XiModels/XiEqModels/XiEqModel/XiEqModel.C
XiModels/XiEqModels/XiEqModel/XiEqModelNew.C
XiModels/XiEqModels/Gulder/Gulder.C
XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C
XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C
XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C
XiModels/XiEqModels/instability2XiEq/instability2XiEq.C
XiModels/XiEqModels/BLMgMaXiEq/BLMgMaXiEq.C
XiModels/XiGModels/XiGModel/XiGModel.C
XiModels/XiGModels/XiGModel/XiGModelNew.C
XiModels/XiGModels/KTS/KTS.C
XiModels/XiGModels/instabilityG/instabilityG.C
XiModels/XiGModels/instability2G/instability2G.C
PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
PDRModels/dragModels/PDRDragModel/PDRDragModel.C
PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C
PDRModels/dragModels/basic/basic.C
PDRModels/dragModels/basicSch/basicSch.C
PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C
PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
PDRModels/XiEqModels/normBasicXiSubXiEq/normBasicXiSubXiEq.C
PDRModels/XiGModels/normBasicXiSubG/normBasicXiSubG.C
laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C
/*PDRFoamAutoRefine.C*/
PDRFoam.C
EXE = $(FOAM_APPBIN)/PDRFoam

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -81,8 +82,11 @@ Description
#include "PDRDragModel.H"
#include "ignition.H"
#include "bound.H"
#include "dynamicFvMesh.H"
#include "dynamicRefineFvMesh.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -95,22 +99,24 @@ int main(int argc, char *argv[])
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "initContinuityErrs.H"
#include "createTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
turbulence->validate();
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -119,33 +125,62 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readDyMControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H"
Info<< "\n\nTime = " << runTime.timeName() << endl;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
fvc::makeAbsolute(phi, rho, U);
// Flux estimate for introduced faces.
volVectorField rhoU("rhoU", rho*U);
bool meshChanged = mesh.controlledUpdate();
if (runTime.write() && meshChanged)
{
betav.write();
betai.write();
Blong.write();
Bv.write();
Lobs.write();
CT.write();
drag->writeFields();
flameWrinkling->writeFields();
}
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, rho, U);
}
if (pimple.firstIter())
{
#include "rhoEqn.H"
}
#include "UEqn.H"
#include "bEqn.H"
#include "ftEqn.H"
#include "EauEqn.H"
#include "EaEqn.H"
if (!ign.ignited())
{
thermo.heu() == thermo.he();
}
// --- Pressure corrector loop
while (pimple.correct())
{
#include "bEqn.H"
#include "ftEqn.H"
#include "EauEqn.H"
#include "EaEqn.H"
if (!ign.ignited())
{
thermo.heu() == thermo.he();
}
#include "pEqn.H"
}
@ -155,12 +190,14 @@ int main(int argc, char *argv[])
}
}
rho = thermo.rho();
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "\n end\n";
Info<< "\nEnd\n" << endl;
return 0;
}

View File

@ -1,216 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
PDRFoam
Description
Solver for compressible premixed/partially-premixed combustion with
turbulence modelling.
Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport
equation or from an algebraic expression. Both approaches are
based on Gulder's flame speed correlation which has been shown
to be appropriate by comparison with the results from the
spectral model.
Strain effects are incorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
model will be required.
For cases involving very lean Propane flames or other flames which are
very strain-sensitive, a transport equation for the laminar flame
speed is present. This equation is derived using heuristic arguments
involving the strain time scale and the strain-rate at extinction.
the transport velocity is the same as that for the Xi equation.
For large flames e.g. explosions additional modelling for the flame
wrinkling due to surface instabilities may be applied.
PDR (porosity/distributed resistance) modelling is included to handle
regions containing blockages which cannot be resolved by the mesh.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiuReactionThermo.H"
#include "turbulentFluidThermoModel.H"
#include "laminarFlameSpeed.H"
#include "XiModel.H"
#include "PDRDragModel.H"
#include "ignition.H"
#include "bound.H"
#include "dynamicRefineFvMesh.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for compressible premixed/partially-premixed combustion with"
" turbulence modelling."
);
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
pimpleControl pimple(mesh);
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "createTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
turbulence->validate();
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
bool hasChanged = false;
while (runTime.run())
{
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
// Indicators for refinement.
// Note: before ++runTime only for post-processing reasons.
tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
volScalarField normalisedGradP
(
"normalisedGradP",
tmagGradP()/max(tmagGradP())
);
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
tmagGradP.clear();
++runTime;
Info<< "\n\nTime = " << runTime.timeName() << endl;
{
// Make the fluxes absolute
fvc::makeAbsolute(phi, rho, U);
// Test : disable refinement for some cells
bitSet& protectedCell =
refCast<dynamicRefineFvMesh>(mesh).protectedCell();
if (protectedCell.empty())
{
protectedCell.setSize(mesh.nCells());
protectedCell = false;
}
forAll(betav, celli)
{
if (betav[celli] < 0.99)
{
protectedCell.set(celli);
}
}
// Flux estimate for introduced faces.
volVectorField rhoU("rhoU", rho*U);
// Do any mesh changes
bool meshChanged = mesh.update();
if (meshChanged)
{
hasChanged = true;
}
if (runTime.write() && hasChanged)
{
betav.write();
Lobs.write();
CT.write();
drag->writeFields();
flameWrinkling->writeFields();
hasChanged = false;
}
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, rho, U);
}
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
runTime.printExecutionTime(Info);
}
Info<< "\n end\n";
return 0;
}
// ************************************************************************* //

View File

@ -1,150 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "basicXiSubXiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiEqModel, basicSubGrid, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::basicSubGrid::basicSubGrid
(
const dictionary& XiEqProperties,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
B_
(
IOobject
(
"B",
Su.mesh().facesInstance(),
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiEqModels::basicSubGrid::~basicSubGrid()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
{
const fvMesh& mesh = Su_.mesh();
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
volScalarField magU(mag(U));
volVectorField Uhat
(
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
);
const scalarField Cw = pow(mesh.V(), 2.0/3.0);
volScalarField N
(
IOobject
(
"N",
mesh.time().constant(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(Nv.dimensions(), Zero)
);
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
volSymmTensorField ns
(
IOobject
(
"ns",
U.mesh().time().timeName(),
U.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U.mesh(),
dimensionedSymmTensor(nsv.dimensions(), Zero)
);
ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
volScalarField XiSubEq
(
scalar(1)
+ max(2.2*sqrt(b), min(0.34*magU/up*sqrt(b), scalar(1.6)))
* min(n, scalar(1))
);
return (XiSubEq*XiEqModel_->XiEq());
}
bool Foam::XiEqModels::basicSubGrid::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
return XiEqModel_->read(XiEqModelCoeffs_);
}
// ************************************************************************* //

View File

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::XiEqModels::basicSubGrid
Description
Basic sub-grid obstacle flame-wrinkling enhancement factor model.
Details supplied by J Puttock 2/7/06.
<b> Sub-grid flame area generation </b>
\f$ n = N - \hat{\dwea{\vec{U}}}.n_{s}.\hat{\dwea{\vec{U}}} \f$
\f$ n_{r} = \sqrt{n} \f$
where:
\f$ \hat{\dwea{\vec{U}}} = \dwea{\vec{U}} / \vert \dwea{\vec{U}}
\vert \f$
\f$ b = \hat{\dwea{\vec{U}}}.B.\hat{\dwea{\vec{U}}} / n_{r} \f$
where:
\f$ B \f$ is the file "B".
\f$ N \f$ is the file "N".
\f$ n_{s} \f$ is the file "ns".
The flame area enhancement factor \f$ \Xi_{sub} \f$ is expected to
approach:
\f[
\Xi_{{sub}_{eq}} =
1 + max(2.2 \sqrt{b}, min(0.34 \frac{\vert \dwea{\vec{U}}
\vert}{{\vec{U}}^{'}}, 1.6)) \times min(\frac{n}{4}, 1)
\f]
SourceFiles
basicSubGrid.C
\*---------------------------------------------------------------------------*/
#ifndef basicSubGrid_H
#define basicSubGrid_H
#include "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class basicSubGrid Declaration
\*---------------------------------------------------------------------------*/
class basicSubGrid
:
public XiEqModel
{
// Private data
//- tblock
volSymmTensorField B_;
//- Equilibrium Xi model due to turbulence
autoPtr<XiEqModel> XiEqModel_;
// Private Member Functions
//- No copy construct
basicSubGrid(const basicSubGrid&) = delete;
//- No copy assignment
void operator=(const basicSubGrid&) = delete;
public:
//- Runtime type information
TypeName("basicSubGrid");
// Constructors
//- Construct from components
basicSubGrid
(
const dictionary& XiEqProperties,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
);
//- Destructor
virtual ~basicSubGrid();
// Member Functions
//- Return the flame-wrinkling XiEq
virtual tmp<volScalarField> XiEq() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiEqModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,219 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "normBasicXiSubXiEq.H"
#include "addToRunTimeSelectionTable.H"
#include "ignition.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(normBasicSubGrid, 0);
addToRunTimeSelectionTable(XiEqModel, normBasicSubGrid, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::normBasicSubGrid::normBasicSubGrid
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, modelType,thermo, turbulence, Su),
Cxpe1_(XiEqModelCoeffs_.get<scalar>("Cxpe1")),
Cxpe2_(XiEqModelCoeffs_.get<scalar>("Cxpe2")),
Cxpe3_(XiEqModelCoeffs_.get<scalar>("Cxpe3")),
Cxpe4_(XiEqModelCoeffs_.get<scalar>("Cxpe4"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiEqModels::normBasicSubGrid::~normBasicSubGrid()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::normBasicSubGrid::XiEq() const
{
const fvMesh& mesh = Su_.mesh();
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
const volScalarField& b = mesh.lookupObject<volScalarField>("b");
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
const volSymmTensorField& Bv =
mesh.lookupObject<volSymmTensorField>("Bv");
volScalarField magU(mag(U));
const scalarField Cw(pow(mesh.V(), 2.0/3.0));
auto tN = tmp<volScalarField>::New
(
IOobject
(
"tN",
mesh.time().constant(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(Nv.dimensions(), Zero)
);
auto& N = tN.ref();
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
auto tns = tmp<volSymmTensorField>::New
(
IOobject
(
"tns",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedSymmTensor(nsv.dimensions(), Zero)
);
auto& ns = tns.ref();
auto tB = tmp<volSymmTensorField>::New
(
IOobject
(
"tB",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedSymmTensor(Bv.dimensions(), Zero)
);
auto& B = tB.ref();
//calculating flame normal
volVectorField flNormal
(
"flNormal",
fvc::reconstruct(fvc::snGrad(b)*mesh.magSf())
);
volScalarField mgb("mgb", mag(flNormal));
dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
const volScalarField bc(b*(1.0-b));
dMgb += 1.0e-8*
(bc*mgb)().weightedAverage(mesh.V())
/(bc.weightedAverage(mesh.V()) + SMALL);
mgb += dMgb;
flNormal /= mgb;
B.primitiveFieldRef() = Bv.primitiveField()*sqrt(Cw);
volScalarField Ntemp("Ntemp", N);
volScalarField Np("Np", max(N - (flNormal & ns & flNormal), scalar(1)));
// B_ is Bv*sqrt(Cw)
volScalarField bl("bl",(flNormal & B & flNormal)/sqrt(Np));
bl.min(1.0);
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
IOdictionary combustionProperties
(
IOobject
(
"combustionProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
ignition ign(combustionProperties, mesh.time(), mesh);
dimensionedVector ignLoc("ignLoc", dimLength, ign.sites()[0].location());
dimensionedScalar filtRad2
(
"filtRad2",
dimLength,
6.0*ign.sites()[0].diameter()
);
const volScalarField filDist(mag(mesh.C() - ignLoc));
const volScalarField filterMult
(
pos(filDist - filtRad2)*neg(bl - 0.99)*pos(N - 1e-3)
);
tmp<volScalarField> XiSubEq
(
scalar(1)
+ min( min(Cxpe1_, Cxpe2_*magU/up)*sqrt(bl), Cxpe3_)
* filterMult
);
return XiSubEq;
}
bool Foam::XiEqModels::normBasicSubGrid::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.readEntry("Cxpe1", Cxpe1_);
XiEqModelCoeffs_.readEntry("Cxpe2", Cxpe2_);
XiEqModelCoeffs_.readEntry("Cxpe3", Cxpe3_);
XiEqModelCoeffs_.readEntry("Cxpe4", Cxpe4_);
return true;
}
// ************************************************************************* //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,20 +24,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::XiEqModels::instability
Foam::XiEqModels::normBasicSubGrid
Description
This is the equilibrium level of the flame wrinkling generated by
instability. It is a constant (default 2.5). It is used in
\link XiModel.H \endlink.
SourceFiles
instability.C
normBasicSubGrid.C
\*---------------------------------------------------------------------------*/
#ifndef instability_H
#define instability_H
#ifndef normBasicSubGrid_H
#define normBasicSubGrid_H
#include "XiEqModel.H"
@ -49,43 +47,44 @@ namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class instability Declaration
Class normBasicSubGrid Declaration
\*---------------------------------------------------------------------------*/
class instability
class normBasicSubGrid
:
public XiEqModel
{
// Private data
// Private Data
//- Equilibrium Xi due to instability only
scalar XiEqIn;
//- Equilibrium Xi model due to all other effects
autoPtr<XiEqModel> XiEqModel_;
// Constants in the equilibrium Xp equation
scalar Cxpe1_;
scalar Cxpe2_;
scalar Cxpe3_;
scalar Cxpe4_;
// Private Member Functions
//- No copy construct
instability(const instability&) = delete;
normBasicSubGrid(const normBasicSubGrid&) = delete;
//- No copy assignment
void operator=(const instability&) = delete;
void operator=(const normBasicSubGrid&) = delete;
public:
//- Runtime type information
TypeName("instability");
TypeName("normBasicSubGrid");
// Constructors
//- Construct from components
instability
normBasicSubGrid
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -93,7 +92,7 @@ public:
//- Destructor
virtual ~instability();
virtual ~normBasicSubGrid();
// Member Functions
@ -103,7 +102,6 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties);
};

View File

@ -1,115 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "basicXiSubG.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
};
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiGModels::basicSubGrid::basicSubGrid
(
const dictionary& XiGProperties,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
k1(XiGModelCoeffs_.get<scalar>("k1")),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiGModels::basicSubGrid::~basicSubGrid()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
{
const objectRegistry& db = Su_.db();
const volVectorField& U = db.lookupObject<volVectorField>("U");
const volScalarField& Nv = db.lookupObject<volScalarField>("Nv");
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
tmp<volScalarField> tGtot = XiGModel_->G();
volScalarField& Gtot = tGtot.ref();
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
scalarField N(Nv.primitiveField()*Cw);
forAll(N, celli)
{
if (N[celli] > 1e-3)
{
Gtot[celli] += k1*mag(U[celli])/Lobs[celli];
}
}
return tGtot;
}
Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::Db() const
{
const objectRegistry& db = Su_.db();
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
return XiGModel_->Db()
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*Lobs)*Lobs/(mgb*Lobs + 1.0);
}
bool Foam::XiGModels::basicSubGrid::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.readEntry("k1", k1);
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,270 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "normBasicXiSubG.H"
#include "zeroGradientFvPatchField.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
defineTypeNameAndDebug(normBasicSubGrid, 0);
addToRunTimeSelectionTable(XiGModel, normBasicSubGrid, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiGModels::normBasicSubGrid::normBasicSubGrid
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
// Bv_
// (
// IOobject
// (
// "Bv",
// Su.mesh().facesInstance(),
// Su.mesh(),
// IOobject::MUST_READ,
// IOobject::NO_WRITE
// ),
// Su.mesh()
// ),
k1_(XiGModelCoeffs_.get<scalar>("k1")),
kb1_(XiGModelCoeffs_.get<scalar>("kb1")),
kbe_(XiGModelCoeffs_.get<scalar>("kbe")),
kbx_(XiGModelCoeffs_.get<scalar>("kbx")),
k2_(XiGModelCoeffs_.get<scalar>("k2")),
LOverCw_(XiGModelCoeffs_.get<scalar>("LOverCw"))
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiGModels::normBasicSubGrid::G() const
{
const objectRegistry& db = Su_.db();
const fvMesh& mesh = Su_.mesh();
const volVectorField& U = db.lookupObject<volVectorField>("U");
const volScalarField& b = db.lookupObject<volScalarField>("b");
const volScalarField& Nv = db.lookupObject<volScalarField>("Nv");
const volScalarField& St = db.lookupObject<volScalarField>("St");
const volSymmTensorField& nsv = db.lookupObject<volSymmTensorField>("nsv");
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
const volSymmTensorField& Bv = db.lookupObject<volSymmTensorField>("Bv");
const scalarField Cw(pow(Su_.mesh().V(), 2.0/3.0));
volScalarField CwVol
(
IOobject
(
"CwVol",
mesh.time().timeName(),
mesh
),
mesh,
dimensionSet(dimLength),
Cw,
zeroGradientFvPatchField<scalar>::typeName
);
CwVol.correctBoundaryConditions();
if (!db.foundObject<volScalarField>("Ep"))
{
FatalErrorInFunction
<< "Looking for Ep in db that does not exist" << nl
<< Foam::abort(FatalError);
}
const volScalarField& Ep = db.lookupObject<volScalarField>("Ep");
const volScalarField& Xp = db.lookupObject<volScalarField>("Xp");
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
//tmp<volScalarField> tGtot = XiGModel_->G();
auto tGtot = tmp<volScalarField>::New
(
IOobject
(
"tGtot",
Su_.mesh().time().timeName(),
Su_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
Su_.mesh(),
dimensionedScalar(inv(dimTime), Zero)
);
auto& Gtot = tGtot.ref();
//calculating flame normal
volVectorField flNormal(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf()));
volScalarField mgb("mgb", mag(flNormal));
dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
{
volScalarField bc(b*(1.0-b));
dMgb += 1.0e-8*
(bc*mgb)().weightedAverage(mesh.V())
/(bc.weightedAverage(mesh.V()) + SMALL);
}
mgb += dMgb;
flNormal /= mgb;
auto tN = tmp<volScalarField>::New
(
IOobject
(
"tN",
Su_.mesh().time().timeName(),
Su_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
Su_.mesh(),
dimensionedScalar(Nv.dimensions(), Zero)
);
auto& N = tN.ref();
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
auto tns = tmp<volSymmTensorField>::New
(
IOobject
(
"tns",
Su_.mesh().time().timeName(),
Su_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
Su_.mesh(),
dimensionedSymmTensor(nsv.dimensions(), Zero)
);
auto& ns = tns.ref();
ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
auto tB = tmp<volSymmTensorField>::New
(
IOobject
(
"tB",
Su_.mesh().time().timeName(),
Su_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
Su_.mesh(),
dimensionedSymmTensor(Bv.dimensions(), Zero)
);
auto& B = tB.ref();
B.primitiveFieldRef() = Bv.primitiveField()*sqrt(Cw);
volScalarField Np(max(N - (flNormal & ns & flNormal), scalar(1)));
// B_ is Bv*sqrt(Cw)
volScalarField bl("bl",(flNormal & B & flNormal)/sqrt(Np));
bl.min(1.0);
volScalarField flSpeed("flSpeed", ((U & flNormal) + St)*b/(b+SMALL)) ;
volScalarField up("up", sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField Gtot1
(
"Gtot1",
(
k1_ + kb1_*min(pow(bl, kbe_), kbx_)
)*mag(flSpeed)/(max(Lobs, LOverCw_*CwVol))
);
const volScalarField Gtot2("Gtot2", k2_*Ep*Su_*Xi/(Xp - 0.999));
const volScalarField value(pos(N - 1.e-3)*neg(bl - 0.99));
Gtot = value*Gtot1+(1.0 - value)*Gtot2;
/// if (Xi.mesh().time().outputTime())
/// {
/// Gtot.write();
/// bl.write();
/// Lobs.write();
/// flSpeed.write();
/// N.write();
/// }
return tGtot;
}
Foam::tmp<Foam::volScalarField> Foam::XiGModels::normBasicSubGrid::Db() const
{
// Not used //
const objectRegistry& db = Su_.db();
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
const volScalarField& Db = db.lookupObject<volScalarField>("Db");
//return turbulence_.muEff()
return Db + rho*Su_*(Xi - 1.0)*mgb*(0.5*Lobs)*Lobs/(mgb*Lobs + 1.0);
}
bool Foam::XiGModels::normBasicSubGrid::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.readEntry("k1", k1_);
XiGModelCoeffs_.readEntry("kb1", kb1_);
XiGModelCoeffs_.readEntry("kbe", kbe_);
XiGModelCoeffs_.readEntry("kbx", kbx_);
XiGModelCoeffs_.readEntry("k2", k2_);
return true;
}
// ************************************************************************* //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,37 +24,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::XiGModels::basicSubGrid
Foam::XiGModel::normBasicSubGrid
Description
Basic sub-grid obstacle flame-wrinkling generation rate coefficient model.
Details supplied by J Puttock 2/7/06.
\f$ G_{sub} \f$ denotes the generation coefficient and it is given by
\f[
G_{sub} = k_{1} /frac{\vert \dwea{\vec{U}} \vert}{L_{obs}}
\frac{/Xi_{{sub}_{eq}}-1}{/Xi_{sub}}
\f]
and the removal:
\f[
- k_{1} /frac{\vert \dwea{\vec{U}} \vert}{L_{sub}}
\frac{\Xi_{sub}-1}{\Xi_{sub}}
\f]
Finally, \f$ G_{sub} \f$ is added to generation rate \f$ G_{in} \f$
due to the turbulence.
SourceFiles
basicSubGrid.C
normBasicSubGrid.C
\*---------------------------------------------------------------------------*/
#ifndef basicSubGrid_H
#define basicSubGrid_H
#ifndef normBasicSubGrid_H
#define normBasicSubGrid_H
#include "XiGModel.H"
@ -66,43 +47,56 @@ namespace XiGModels
{
/*---------------------------------------------------------------------------*\
Class basicSubGrid Declaration
Class normBasicSubGrid Declaration
\*---------------------------------------------------------------------------*/
class basicSubGrid
class normBasicSubGrid
:
public XiGModel
{
// Private data
// Private Data
//- Sub-grid generation rate coefficient
scalar k1;
scalar k1_;
//- Xi generation rate model due to turbulence
autoPtr<XiGModel> XiGModel_;
//- Sub-grid generation rate coefficient - * sqrt(b)
scalar kb1_;
//- Sub-grid generation rate coefficient - * b
scalar kbe_;
//- Sub-grid generation rate upper limit coefficient - * b
scalar kbx_;
//- Sub-grid generation rate coefficient
scalar k2_;
//- Maximum Lobs/CellWidth
scalar LOverCw_;
// Private Member Functions
//- No copy construct
basicSubGrid(const basicSubGrid&) = delete;
normBasicSubGrid(const normBasicSubGrid&) = delete;
//- No copy assignment
void operator=(const basicSubGrid&) = delete;
void operator=(const normBasicSubGrid&) = delete;
public:
//- Runtime type information
TypeName("basicSubGridG");
TypeName("normBasicSubGridG");
// Constructors
//- Construct from components
basicSubGrid
normBasicSubGrid
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -110,7 +104,7 @@ public:
//- Destructor
virtual ~basicSubGrid();
virtual ~normBasicSubGrid() = default;
// Member Functions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -81,7 +81,7 @@ Foam::PDRDragModel::~PDRDragModel()
bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
{
PDRDragModelCoeffs_ = PDRProperties.optionalSubDict(type() + "Coeffs");
PDRDragModelCoeffs_ = PDRProperties.subDict(type() + "Coeffs");
PDRDragModelCoeffs_.readEntry("drag", on_);
@ -89,4 +89,10 @@ bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
}
void Foam::PDRDragModel::writeFields() const
{
NotImplemented;
}
// ************************************************************************* //

View File

@ -57,10 +57,9 @@ class PDRDragModel
:
public regIOobject
{
protected:
// Protected data
// Protected Data
dictionary PDRDragModelCoeffs_;
@ -72,9 +71,7 @@ protected:
bool on_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
PDRDragModel(const PDRDragModel&) = delete;
@ -146,7 +143,7 @@ public:
// Member Functions
//- Return true if the drag model is switched on
bool on() const
bool on() const noexcept
{
return on_;
}
@ -161,17 +158,16 @@ public:
using regIOobject::read;
//- Update properties from given dictionary
virtual bool read(const dictionary& PDRProperties) = 0;
virtual bool read(const dictionary& PDRProperties);
//- Write Data
virtual bool writeData(Ostream&) const
{
return true;
}
virtual void writeFields() const
{
NotImplemented;
}
//- Write fields
virtual void writeFields() const;
};

View File

@ -56,8 +56,7 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
) << exit(FatalIOError);
}
return autoPtr<PDRDragModel>
(cstrIter()(dict, turbulence, rho, U, phi));
return autoPtr<PDRDragModel>(cstrIter()(dict, turbulence, rho, U, phi));
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -93,24 +93,20 @@ Foam::PDRDragModels::basic::~basic()
Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
{
tmp<volSymmTensorField> tDragDcu
auto tDragDcu = tmp<volSymmTensorField>::New
(
new volSymmTensorField
IOobject
(
IOobject
(
"tDragDcu",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"tDragDcu",
U_.mesh().time().constant(),
U_.mesh(),
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
)
IOobject::NO_READ,
IOobject::NO_WRITE
),
U_.mesh(),
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
);
volSymmTensorField& DragDcu = tDragDcu.ref();
auto& DragDcu = tDragDcu.ref();
if (on_)
{
@ -127,24 +123,20 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
{
tmp<volScalarField> tGk
auto tGk = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"tGk",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"tGk",
U_.mesh().time().constant(),
U_.mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
IOobject::NO_READ,
IOobject::NO_WRITE
),
U_.mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
volScalarField& Gk = tGk.ref();
auto& Gk = tGk.ref();
if (on_)
{
@ -159,6 +151,7 @@ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
+ Csk*betav*turbulence_.muEff()*sqr(Aw_)*magSqr(U_);
}
return tGk;
}
@ -180,4 +173,5 @@ void Foam::PDRDragModels::basic::writeFields() const
CR_.write();
}
// ************************************************************************* //

View File

@ -99,7 +99,7 @@ class basic
:
public PDRDragModel
{
// Private data
// Private Data
dimensionedScalar Csu;
dimensionedScalar Csk;

View File

@ -0,0 +1,296 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "basicSch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace PDRDragModels
{
defineTypeNameAndDebug(basicSch, 0);
addToRunTimeSelectionTable(PDRDragModel, basicSch, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::PDRDragModels::basicSch::basicSch
(
const dictionary& PDRProperties,
const compressible::RASModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
)
:
PDRDragModel(PDRProperties,turbulence, rho, U, phi),
Csu("Csu", dimless, PDRDragModelCoeffs_),
Csk("Csk", dimless, PDRDragModelCoeffs_),
Aw_
(
IOobject
(
"Aw",
U_.mesh().facesInstance(),
U_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
U_.mesh()
),
CR_
(
IOobject
(
"CR",
U_.mesh().facesInstance(),
U_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
U_.mesh()
),
nrCoef_(PDRDragModelCoeffs_.get<scalar>("nrCoef")),
nrExp2_(PDRDragModelCoeffs_.get<scalar>("nrExp2")),
lCoef_(PDRDragModelCoeffs_.get<scalar>("lCoef")),
maxSchFac_(PDRDragModelCoeffs_.get<scalar>("maxSchFac")),
subGridSchelkin_(PDRDragModelCoeffs_.get<bool>("subGridSchelkin"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::PDRDragModels::basicSch::~basicSch()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basicSch::Dcu() const
{
auto tDragDcu = tmp<volSymmTensorField>::New
(
IOobject
(
"tDragDcu",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U_.mesh(),
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
);
auto& DragDcu = tDragDcu.ref();
if (on_)
{
const volScalarField& betav =
U_.db().lookupObject<volScalarField>("betav");
DragDcu =
(0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*sqr(Aw_);
}
return tDragDcu;
}
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basicSch::Gk() const
{
auto tGk = tmp<volScalarField>::New
(
IOobject
(
"tGk",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U_.mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
auto& Gk = tGk.ref();
if (on_)
{
const volScalarField& betav =
U_.db().lookupObject<volScalarField>("betav");
const volSymmTensorField& CT =
U_.db().lookupObject<volSymmTensorField>("CT");
Gk =
(0.5*rho_)*mag(U_)*(U_ & CT & U_)
+ Csk*betav*turbulence_.muEff()*sqr(Aw_)*magSqr(U_);
if (subGridSchelkin_)
{
Gk *= this->SchelkinFactor();
}
}
return tGk;
}
Foam::tmp<Foam::volScalarField>
Foam::PDRDragModels::basicSch::SchelkinFactor() const
{
const volScalarField& Su_ = U_.db().lookupObject<volScalarField>("Su");
const volScalarField& rhou_ = U_.db().lookupObject<volScalarField>("rhou");
const volScalarField& muu_ = U_.db().lookupObject<volScalarField>("muu");
auto tfac = tmp<volScalarField>::New
(
IOobject
(
"tfac",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U_.mesh(),
dimensionedScalar(dimless, Zero)
);
auto& schFac = tfac.ref();
const volScalarField& k = turbulence_.k();
const volScalarField& epsilon = turbulence_.epsilon();
const volScalarField up(sqrt((2.0/3.0)*k));
const volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
volScalarField Rs(Su_*l*rhou_/muu_);
if (subGridSchelkin_)
{
schFac = max
(
1.0,
min
(
maxSchFac_,
pow(Rs, 2.0 * SchelkinExponent(nrCoef_, nrExp2_, Su_))
)
);
}
return tfac;
}
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basicSch::SchelkinExponent
(
const scalar nrCoef,
const scalar nrExp,
const volScalarField& Su
) const
{
const fvMesh& mesh = Su.mesh();
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
auto tN = tmp<volScalarField>::New
(
IOobject
(
"tN",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar(Nv.dimensions(), Zero)
);
auto& N = tN.ref();
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
auto tns = tmp<volSymmTensorField>::New
(
IOobject
(
"tns",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedSymmTensor(nsv.dimensions(), Zero)
);
auto& ns = tns.ref();
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
(
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
);
const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1.0))));
//Re use tN
N.primitiveFieldRef() =
nrCoef*((scalar(1.0) - pow(nrExp, nr))/(1.0 - nrExp) - scalar(1.0));
return tN;
}
bool Foam::PDRDragModels::basicSch::read(const dictionary& PDRProperties)
{
PDRDragModel::read(PDRProperties);
PDRDragModelCoeffs_.readEntry("Csu", Csu.value());
PDRDragModelCoeffs_.readEntry("Csk", Csk.value());
return true;
}
void Foam::PDRDragModels::basicSch::writeFields() const
{
Aw_.write();
CR_.write();
}
// ************************************************************************* //

View File

@ -0,0 +1,141 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::PDRDragModels::basicSch
Description
SourceFiles
basicSch.C
\*---------------------------------------------------------------------------*/
#ifndef basicSch_H
#define basicSch_H
#include "PDRDragModel.H"
#include "XiEqModel.H"
namespace Foam
{
namespace PDRDragModels
{
/*---------------------------------------------------------------------------*\
Class basicSch Declaration
\*---------------------------------------------------------------------------*/
class basicSch
:
public PDRDragModel
{
// Private Data
dimensionedScalar Csu;
dimensionedScalar Csk;
volScalarField Aw_;
volSymmTensorField CR_;
//- Schelkin effect Model constants
const scalar nrCoef_;
const scalar nrExp2_;
const scalar lCoef_;
const scalar maxSchFac_;
//- Use sub-grid Schelkin effect
bool subGridSchelkin_;
// Private Member Functions
//- No copy construct
basicSch(const basicSch&) = delete;
//- No copy assignment
void operator=(const basicSch&) = delete;
public:
//- Runtime type information
TypeName("basicSch");
// Constructors
//- Construct from components
basicSch
(
const dictionary& PDRProperties,
const compressible::RASModel& turbulence,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
);
//- Destructor
virtual ~basicSch();
// Member Functions
//- Return the momentum drag coefficient
virtual tmp<volSymmTensorField> Dcu() const;
//- Return the momentum drag turbulence generation rate
virtual tmp<volScalarField> Gk() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& PDRProperties);
//- Write fields
void writeFields() const;
//- Return the Schelkin factor for drag turbulence generation rate
tmp<volScalarField> SchelkinFactor() const;
//- Return the sub-grid Schelkin effect exponent
tmp<volScalarField> SchelkinExponent
(
const scalar,
const scalar,
const volScalarField&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace PDRDragModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,6 +29,7 @@ License
#include "PDRkEpsilon.H"
#include "PDRDragModel.H"
#include "addToRunTimeSelectionTable.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -70,16 +71,40 @@ PDRkEpsilon::PDRkEpsilon
modelName
),
C4_
C5_(coeffDict_.get<scalar>("C5")),
C6_(coeffDict_.get<scalar>("C6")),
maxLOverCellW_(coeffDict_.get<scalar>("maxLOverCellW")),
lCoef_(coeffDict_.get<scalar>("lCoef")),
noTurbUntil_
(
dimensioned<scalar>::getOrAddToDict
dimensioned<scalar>::lookupOrAddToDict
(
"C4",
"noTurbUntil",
coeffDict_,
0.1
0.0
)
)
{}
),
LOverLobs_
(
dimensioned<scalar>::lookupOrAddToDict
(
"LOverLobs",
coeffDict_,
0.2
)
),
LOverMobs_
(
dimensioned<scalar>::lookupOrAddToDict
(
"LOverMobs",
coeffDict_,
0.0
)
),
bMin_(coeffDict_.get<scalar>("bMin")),
flameFilteredG_(coeffDict_.get<bool>("flameFilteredG"))
{}
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
@ -94,7 +119,9 @@ bool PDRkEpsilon::read()
{
if (RASModel::read())
{
C4_.readIfPresent(coeffDict_);
noTurbUntil_.readIfPresent(coeffDict_);
LOverLobs_.readIfPresent(coeffDict_);
LOverMobs_.readIfPresent(coeffDict_);
return true;
}
@ -110,16 +137,12 @@ void PDRkEpsilon::correct()
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
// Re-calculate thermal diffusivity
//***HGWalphat_ = mut_/Prt_;
//alphat_.correctBoundaryConditions();
return;
}
RASModel::correct();
volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_)));
volScalarField divU("divU",fvc::div(phi_/fvc::interpolate(rho_)));
if (mesh_.moving())
{
@ -127,7 +150,9 @@ void PDRkEpsilon::correct()
}
tmp<volTensorField> tgradU = fvc::grad(U_);
volScalarField G(GName(), rho_*nut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear();
// Update epsilon and G at the wall
@ -141,59 +166,102 @@ void PDRkEpsilon::correct()
const volScalarField& Lobs =
U_.db().lookupObject<volScalarField>("Lobs");
const volVectorField& U = mesh_.lookupObject<volVectorField>("U");
const volScalarField& b = mesh_.lookupObject<volScalarField>("b");
const scalarField Cw(pow(mesh_.V(), 2.0/3.0));
const PDRDragModel& drag =
U_.db().lookupObject<PDRDragModel>("PDRDragModel");
volScalarField GR(drag.Gk());
volScalarField LI
(C4_*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL)));
// Dissipation equation
tmp<fvScalarMatrix> epsEqn
volScalarField LD
(
betav*fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::laplacian(rho_*DepsilonEff(), epsilon_)
==
C1_*betav*G*epsilon_/k_
+ 1.5*pow(Cmu_, 3.0/4.0)*GR*sqrt(k_)/LI
- fvm::SuSp(((2.0/3.0)*C1_)*betav*rho_*divU, epsilon_)
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
"LD",
(LOverLobs_)*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL))
);
epsEqn.ref().relax();
LD.primitiveFieldRef() = min(LD.primitiveField(), maxLOverCellW_*sqrt(Cw));
epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
const volScalarField LI(lCoef_*pow(k_, 3.0/2.0)/epsilon_);
solve(epsEqn);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
tmp<fvScalarMatrix> kEqn
IOdictionary combustionProperties
(
betav*fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::laplacian(rho_*DkEff(), k_)
==
betav*G + GR
- fvm::SuSp((2.0/3.0)*betav*rho_*divU, k_)
- fvm::Sp(betav*rho_*epsilon_/k_, k_)
IOobject
(
"combustionProperties",
mesh_.time().constant(),
mesh_,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
kEqn.ref().relax();
solve(kEqn);
bound(k_, kMin_);
ignition ign(combustionProperties, mesh_.time(), U.mesh());
dimensionedVector ignLoc("ignLoc", dimLength, ign.sites()[0].location());
dimensionedScalar filtRad2
(
"filtRad2",
dimLength,
6.0*ign.sites()[0].diameter()
);
if (flameFilteredG_)
{
const volScalarField filDist(mag(mesh_.C() - ignLoc));
const volScalarField filterG(pos(filDist - filtRad2));
const volScalarField filterdivU(pos(filDist - filtRad2));
const volScalarField filterGR(pos(filDist - filtRad2)*pos(b - bMin_));
G *= filterG;
GR *= filterGR;
divU *= filterdivU;
}
volScalarField Cl(C5_ + (C6_*((LI - LD)/LI)));
Cl.max(0.0);
if (mesh_.time() > noTurbUntil_)
{
tmp<fvScalarMatrix> epsEqn
(
betav*fvm::ddt(rho_, epsilon_)
+ fvm::div(phi_, epsilon_)
- fvm::laplacian(rho_*DepsilonEff(), epsilon_)
==
C1_*betav*G*epsilon_/k_
+ Cl*(epsilon_/k_)*GR
- fvm::SuSp(((2.0/3.0)*C1_+C3_)*betav*rho_*divU, epsilon_)
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
);
epsEqn.ref().relax();
epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
solve(epsEqn);
bound(epsilon_, epsilonMin_);
tmp<fvScalarMatrix> kEqn
(
betav*fvm::ddt(rho_, k_)
+ fvm::div(phi_, k_)
- fvm::laplacian(rho_*DkEff(), k_)
==
(betav*G + GR)
- fvm::SuSp((2.0/3.0)*betav*rho_*divU, k_)
- fvm::Sp(betav*rho_*epsilon_/k_, k_)
);
kEqn.ref().relax();
solve(kEqn);
bound(k_, kMin_);
}
// Re-calculate viscosity
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
// Re-calculate thermal diffusivity
//***HGWalphat_ = mut_/Prt_;
//alphat_.correctBoundaryConditions();
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,30 +31,6 @@ Description
Standard k-epsilon turbulence model with additional source terms
corresponding to PDR basic drag model (\link basic.H \endlink)
The default model coefficients correspond to the following:
\verbatim
PDRkEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33; // only for compressible
C4 0.1;
sigmak 1.0; // only for compressible
sigmaEps 1.3;
Prt 1.0; // only for compressible
}
\endverbatim
The turbulence source term \f$ G_{R} \f$ appears in the
\f$ \kappa-\epsilon \f$ equation for the generation of turbulence due to
interaction with unresolved obstacles.
In the \f$ \epsilon \f$ equation \f$ C_{1} G_{R} \f$ is added as a source
term.
In the \f$ \kappa \f$ equation \f$ G_{R} \f$ is added as a source term.
SourceFiles
PDRkEpsilon.C
@ -63,6 +40,7 @@ SourceFiles
#define compressiblePDRkEpsilon_H
#include "kEpsilon.H"
#include "ignition.H"
#include "turbulentFluidThermoModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -88,10 +66,18 @@ class PDRkEpsilon
>
>
{
// Private data
// Private Data
// Model coefficients
dimensionedScalar C4_;
scalar C5_;
scalar C6_;
scalar maxLOverCellW_;
scalar lCoef_;
dimensionedScalar noTurbUntil_;
dimensionedScalar LOverLobs_;
dimensionedScalar LOverMobs_;
scalar bMin_;
bool flameFilteredG_;
public:

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,10 +36,9 @@ Description
if (mesh.nInternalFaces())
{
scalarField sumPhi
scalarField sumPhi
(
fvc::surfaceSum(mag(phiSt))().primitiveField()
/ rho.primitiveField()
fvc::surfaceSum(mag(phiSt))().primitiveField()/rho.primitiveField()
);
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

View File

@ -1,9 +1,6 @@
MRF.correctBoundaryVelocity(U);
fvVectorMatrix UEqn
(
betav*fvm::ddt(rho, U) + fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
betav*rho*g

View File

@ -0,0 +1,258 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "BLMgMaXiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(BLMgMaXiEq, 0);
addToRunTimeSelectionTable(XiEqModel, BLMgMaXiEq, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::BLMgMaXiEq::BLMgMaXiEq
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, modelType, thermo, turbulence, Su),
kaCoef_(XiEqModelCoeffs_.get<scalar>("kaCoef")),
lowK0_(XiEqModelCoeffs_.get<scalar>("lowK0")),
lowKg_(XiEqModelCoeffs_.get<scalar>("lowKg")),
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
alphaCoefP_(XiEqModelCoeffs_.get<scalar>("alphaCoefP")),
betaCoefP_(XiEqModelCoeffs_.get<scalar>("betaCoefP")),
alphaCoefN_(XiEqModelCoeffs_.get<scalar>("alphaCoefN")),
betaCoefN_(XiEqModelCoeffs_.get<scalar>("betaCoefN")),
maLim_(XiEqModelCoeffs_.get<scalar>("maLim")),
maLim1_(XiEqModelCoeffs_.get<scalar>("maLim1")),
quenchCoef_(XiEqModelCoeffs_.get<scalar>("quenchCoef")),
quenchExp_(XiEqModelCoeffs_.get<scalar>("quenchExp")),
quenchM_(XiEqModelCoeffs_.get<scalar>("quenchM")),
quenchRate1_(XiEqModelCoeffs_.get<scalar>("quenchRate1")),
quenchRate2_(XiEqModelCoeffs_.get<scalar>("quenchRate2")),
lCoef_(XiEqModelCoeffs_.get<scalar>("lCoef")),
SuMin_(0.01*Su.average()),
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
nrExp_(XiEqModelCoeffs_.get<scalar>("nrExp")),
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin")),
MaModel
(
IOdictionary
(
IOobject
(
"combustionProperties",
Su.mesh().time().constant(),
Su.mesh(),
IOobject::MUST_READ
)
),
thermo
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiEqModels::BLMgMaXiEq::~BLMgMaXiEq()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::BLMgMaXiEq::XiEq() const
{
const volScalarField& k = turbulence_.k();
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField up("up", sqrt((2.0/3.0)*k));
if (subGridSchelkin_)
{
up.primitiveFieldRef() +=
calculateSchelkinEffect(uPrimeCoef_, nrExp_);
}
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
volScalarField upBySu("upBySu", up/(Su_ + SuMin_));
volScalarField K("K", kaCoef_*upBySu*upBySu/sqrt(Rl));
volScalarField Ma("Ma", MaModel.Ma());
volScalarField regime("regime", MaModel.Ma()*scalar(0.0));
auto tXiEq = tmp<volScalarField>::New
(
IOobject
(
"XiEq",
epsilon.time().timeName(),
epsilon.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
epsilon.mesh(),
dimensionedScalar(dimless, Zero)
);
const objectRegistry& db = Su_.db();
const volScalarField& b = db.lookupObject<volScalarField>("b");
const volScalarField multiP1(0.0*pos(b - 0.99) + 1.0*neg(b - 0.99));
const volScalarField multiP2(1.0*pos(b - 0.01) + 0.0*neg(b - 0.01));
volScalarField& xieq = tXiEq.ref();
forAll(xieq, celli)
{
scalar alpha;
scalar beta;
scalar gulderMa;
if (Ma[celli]>= 0)
{
gulderMa =
1.0
+ (0.1402 - 0.007*Ma[celli])
* upBySu[celli]*sqrt(upBySu[celli]/K[celli]);
regime[celli] = multiP1[celli]*multiP2[celli];
}
else
{
gulderMa =
1.0
+ (0.005*Ma[celli]*Ma[celli]+0.01*Ma[celli] + 0.125)
* upBySu[celli]*sqrt(upBySu[celli]/K[celli]);
regime[celli] = 2*multiP1[celli]*multiP2[celli];
}
if (K[celli] < (lowK0_ + lowKg_*Ma[celli]) )
{
xieq[celli] = gulderMa;
}
else
{
if (Ma[celli] >= 0.0)
{
alpha = alphaCoefP_*(maLim_ - Ma[celli]);
beta = betaCoefP_*(maLim_ - Ma[celli]);
regime[celli] = 3*multiP1[celli]*multiP2[celli];
}
else
{
alpha = alphaCoefN_*(maLim1_ - Ma[celli]) ;
beta = betaCoefN_*(maLim_ + Ma[celli]);
regime[celli] = 4*multiP1[celli]*multiP2[celli];
}
xieq[celli] = XiEqCoef_*alpha*pow(K[celli], beta)*upBySu[celli];
}
if (Ma[celli] > -3.0 && Ma[celli] < 11.0)
{
scalar K0p8 = quenchCoef_*pow( Ma[celli] - quenchM_, quenchExp_);
scalar quenchRate = quenchRate1_ + quenchRate2_*Ma[celli];
if (K[celli] > (K0p8 - 0.223/quenchRate))
{
xieq[celli] *= 0.8*exp(-quenchRate*(K[celli] - K0p8));
regime[celli] = 5*multiP1[celli]*multiP2[celli];
}
}
}
forAll(xieq.boundaryField(), patchi)
{
scalarField& xieqp = xieq.boundaryFieldRef()[patchi];
const scalarField& Kp = K.boundaryField()[patchi];
const scalarField& Map = Ma.boundaryField()[patchi];
const scalarField& upBySup = upBySu.boundaryField()[patchi];
forAll(xieqp, facei)
{
scalar alpha;
scalar beta;
if (Map[facei] > 0.0)
{
alpha = alphaCoefP_*(maLim_ - Map[facei]);
beta = betaCoefP_*(maLim_ - Map[facei]);
}
else
{
alpha = alphaCoefN_*(maLim_ - Map[facei]);
beta = betaCoefN_*(maLim_ + Map[facei]);
}
xieqp[facei] =
XiEqCoef_*alpha*pow(Kp[facei], beta)*upBySup[facei];
if (Map[facei] > -3.0 && Map[facei] < 11.0)
{
scalar K0p8 = quenchCoef_*pow(Map[facei] - quenchM_, quenchExp_);
scalar quenchRate = quenchRate1_ + quenchRate2_*Ma[facei];
if (Kp[facei] > (K0p8 - 0.223/quenchRate))
{
xieqp[facei] *= 0.8*exp(-quenchRate*(Kp[facei] - K0p8));
}
}
else
{
Info<<
"Markstein Number out of range for Quench Formulation" << endl;
}
}
}
return tXiEq;
}
bool Foam::XiEqModels::BLMgMaXiEq::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
return true;
}
// ************************************************************************* //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,21 +24,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::XiEqModels::SCOPEXiEq
Foam::XiEqModel::BLMgMaXiEq
Description
Simple SCOPEXiEq model for XiEq based on SCOPEXiEqs correlation
Model for XiEq based on Bradley, Lawes and Mansour (2011)
Cobustion and Falme, 158, 123 correlation
with a linear correction function to give a plausible profile for XiEq.
See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE laminar
flame speed model.
SourceFiles
SCOPEXiEq.C
BLMgMaXiEq.C
\*---------------------------------------------------------------------------*/
#ifndef SCOPEXiEq_H
#define SCOPEXiEq_H
#ifndef BLMgMaXiEq_H
#define BLMgMaXiEq_H
#include "XiEqModel.H"
#include "SCOPELaminarFlameSpeed.H"
@ -51,29 +52,37 @@ namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class SCOPEXiEq Declaration
Class BLMgMaXiEq Declaration
\*---------------------------------------------------------------------------*/
class SCOPEXiEq
class BLMgMaXiEq
:
public XiEqModel
{
// Private data
// Model constant
// Model constants
scalar kaCoef_;
scalar lowK0_;
scalar lowKg_;
scalar XiEqCoef_;
// Model constant
scalar XiEqExp_;
// Model constant
scalar alphaCoefP_;
scalar betaCoefP_;
scalar alphaCoefN_;
scalar betaCoefN_;
scalar maLim_;
scalar maLim1_;
scalar quenchCoef_, quenchExp_, quenchM_;
scalar quenchRate1_, quenchRate2_;
scalar lCoef_;
//- Minimum Su
dimensionedScalar SuMin_;
//- Schelkin effect Model constant
//- Schelkin effect Model constants
scalar uPrimeCoef_;
scalar nrExp_;
//- Use sub-grid Schelkin effect
bool subGridSchelkin_;
@ -87,24 +96,25 @@ class SCOPEXiEq
// Private Member Functions
//- No copy construct
SCOPEXiEq(const SCOPEXiEq&) = delete;
BLMgMaXiEq(const BLMgMaXiEq&) = delete;
//- No copy assignment
void operator=(const SCOPEXiEq&) = delete;
void operator=(const BLMgMaXiEq&) = delete;
public:
//- Runtime type information
TypeName("SCOPEXiEq");
TypeName("BLMgMaXiEq");
// Constructors
//- Construct from components
SCOPEXiEq
BLMgMaXiEq
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -112,7 +122,7 @@ public:
//- Destructor
virtual ~SCOPEXiEq();
virtual ~BLMgMaXiEq();
// Member Functions

View File

@ -5,7 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,22 +46,21 @@ namespace XiEqModels
Foam::XiEqModels::Gulder::Gulder
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqModel(XiEqProperties, modelType, thermo, turbulence, Su),
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
SuMin_(0.01*Su.average()),
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiEqModels::Gulder::~Gulder()
nrExp_(XiEqModelCoeffs_.get<scalar>("nrExp")),
subGridSchelkin_
(
XiEqModelCoeffs_.get<bool>("subGridSchelkin")
)
{}
@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
if (subGridSchelkin_)
{
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_, nrExp_);
}
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
@ -97,6 +97,7 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_);
XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_);
XiEqModelCoeffs_.readEntry("nrExp", nrExp_);
XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_);
return true;

View File

@ -55,7 +55,7 @@ class Gulder
:
public XiEqModel
{
// Private data
// Private Data
//- Model constant
scalar XiEqCoef_;
@ -66,6 +66,8 @@ class Gulder
//- Schelkin effect Model constant
scalar uPrimeCoef_;
scalar nrExp_;
//- Use sub-grid Schelkin effect
bool subGridSchelkin_;
@ -91,6 +93,7 @@ public:
Gulder
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -98,7 +101,7 @@ public:
//- Destructor
virtual ~Gulder();
virtual ~Gulder() = default;
// Member Functions
@ -108,7 +111,6 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties);
};

View File

@ -1,159 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "SCOPEXiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(SCOPEXiEq, 0);
addToRunTimeSelectionTable(XiEqModel, SCOPEXiEq, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
(
const dictionary& XiEqProperties,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
XiEqExp_(XiEqModelCoeffs_.get<scalar>("XiEqExp")),
lCoef_(XiEqModelCoeffs_.get<scalar>("lCoef")),
SuMin_(0.01*Su.average()),
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin")),
MaModel
(
Su.mesh().lookupObject<IOdictionary>("combustionProperties"),
thermo
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiEqModels::SCOPEXiEq::~SCOPEXiEq()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
{
const volScalarField& k = turbulence_.k();
const volScalarField& epsilon = turbulence_.epsilon();
volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin_)
{
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
}
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
volScalarField upBySu(up/(Su_ + SuMin_));
volScalarField K(0.157*upBySu/sqrt(Rl));
volScalarField Ma(MaModel.Ma());
tmp<volScalarField> tXiEq
(
new volScalarField
(
IOobject
(
"XiEq",
epsilon.time().timeName(),
epsilon.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
epsilon.mesh(),
dimensionedScalar(dimless, Zero)
)
);
volScalarField& xieq = tXiEq.ref();
forAll(xieq, celli)
{
if (Ma[celli] > 0.01)
{
xieq[celli] =
XiEqCoef_*pow(K[celli]*Ma[celli], -XiEqExp_)*upBySu[celli];
}
}
volScalarField::Boundary& xieqBf = xieq.boundaryFieldRef();
forAll(xieq.boundaryField(), patchi)
{
scalarField& xieqp = xieqBf[patchi];
const scalarField& Kp = K.boundaryField()[patchi];
const scalarField& Map = Ma.boundaryField()[patchi];
const scalarField& upBySup = upBySu.boundaryField()[patchi];
forAll(xieqp, facei)
{
if (Ma[facei] > 0.01)
{
xieqp[facei] =
XiEqCoef_*pow(Kp[facei]*Map[facei], -XiEqExp_)
*upBySup[facei];
}
}
}
return tXiEq;
}
bool Foam::XiEqModels::SCOPEXiEq::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_);
XiEqModelCoeffs_.readEntry("XiEqExp", XiEqExp_);
XiEqModelCoeffs_.readEntry("lCoef", lCoef_);
XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_);
XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_);
return true;
}
// ************************************************************************* //

View File

@ -5,7 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -41,6 +42,7 @@ namespace Foam
Foam::XiEqModel::XiEqModel
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -50,7 +52,7 @@ Foam::XiEqModel::XiEqModel
(
XiEqProperties.subDict
(
XiEqProperties.get<word>("XiEqModel") + "Coeffs"
XiEqProperties.get<word>(modelType) + "Coeffs"
)
),
thermo_(thermo),
@ -69,56 +71,51 @@ Foam::XiEqModel::~XiEqModel()
bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
{
XiEqModelCoeffs_ = XiEqProperties.optionalSubDict(type() + "Coeffs");
XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs");
return true;
}
void Foam::XiEqModel::writeFields() const
{
//***HGW It is not clear why B is written here
if (Su_.mesh().foundObject<volSymmTensorField>("B"))
{
const volSymmTensorField& B =
Su_.mesh().lookupObject<volSymmTensorField>("B");
B.write();
}
}
{}
Foam::tmp<Foam::volScalarField>
Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
Foam::tmp<Foam::volScalarField>Foam::XiEqModel::calculateSchelkinEffect
(
const scalar uPrimeCoef,
const scalar nrExp
) const
{
const fvMesh& mesh = Su_.mesh();
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT");
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
tmp<volScalarField> tN
auto tN = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"tN",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"tN",
mesh.time().timeName(),
mesh,
dimensionedScalar(Nv.dimensions(), Zero)
)
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar(Nv.dimensions(), Zero)
);
volScalarField& N = tN.ref();
auto& N = tN.ref();
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
volSymmTensorField ns
auto tns = tmp<volSymmTensorField>::New
(
IOobject
(
@ -131,6 +128,8 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
mesh,
dimensionedSymmTensor(nsv.dimensions(), Zero)
);
auto& ns = tns.ref();
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
@ -144,10 +143,8 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
const scalarField upLocal(uPrimeCoef*sqrt((U & CT & U)*cellWidth));
const scalarField deltaUp(upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0));
// Re use tN
N.primitiveFieldRef() = upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0);
//Re use tN
N.primitiveFieldRef() = upLocal*(max(scalar(1.0), pow(nr, nrExp)) - 1.0);
return tN;
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,12 +29,6 @@ Class
Description
Base-class for all XiEq models used by the b-XiEq combustion model.
The available models are :
\link basicXiSubXiEq.H \endlink
\link Gulder.H \endlink
\link instabilityXiEq.H \endlink
\link SCOPEBlendXiEq.H \endlink
\link SCOPEXiEq.H \endlink
SourceFiles
XiEqModel.C
@ -59,10 +54,9 @@ namespace Foam
class XiEqModel
{
protected:
// Protected data
// Protected Data
//- Dictionary
dictionary XiEqModelCoeffs_;
@ -77,9 +71,7 @@ protected:
const volScalarField& Su_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
XiEqModel(const XiEqModel&) = delete;
@ -103,12 +95,14 @@ public:
dictionary,
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
),
(
XiEqProperties,
modelType,
thermo,
turbulence,
Su
@ -122,6 +116,7 @@ public:
static autoPtr<XiEqModel> New
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -134,6 +129,7 @@ public:
XiEqModel
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -147,13 +143,14 @@ public:
// Member Functions
//- Return the flame-wrinkling XiEq
virtual tmp<volScalarField> XiEq() const
{
return turbulence_.muEff();
}
virtual tmp<volScalarField> XiEq() const = 0;
//- Return the sub-grid Schelkin effect
tmp<volScalarField> calculateSchelkinEffect(const scalar) const;
// Only used by sperseded modles
tmp<volScalarField> calculateSchelkinEffect
(
const scalar uPrimeCoef,
const scalar nrExp
) const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties) = 0;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,14 +33,15 @@ License
Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
(
const dictionary& dict,
const word& modelName,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
{
const word modelType(dict.get<word>("XiEqModel"));
const word modelType(dict.get<word>(modelName));
Info<< "Selecting flame-wrinkling model " << modelType << endl;
Info<< "Selecting flame-wrinkling model Eq " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
@ -49,13 +50,16 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
FatalIOErrorInLookup
(
dict,
"XiEqModel",
modelName,
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalIOError);
}
return autoPtr<XiEqModel>(cstrIter()(dict, thermo, turbulence, Su));
return autoPtr<XiEqModel>(cstrIter()
(
dict, modelName, thermo, turbulence, Su)
);
}

View File

@ -0,0 +1,133 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "instability2XiEq.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiEqModels
{
defineTypeNameAndDebug(instability2XiEq, 0);
addToRunTimeSelectionTable(XiEqModel, instability2XiEq, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiEqModels::instability2XiEq::instability2XiEq
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiEqModel(XiEqProperties, modelType, thermo, turbulence, Su),
saModel_
(
IOdictionary
(
IOobject
(
"combustionProperties",
Su.mesh().time().constant(),
Su.mesh(),
IOobject::MUST_READ
)
),
thermo
),
CIn_(saModel_.CIn()),
defaultCIn_(XiEqModelCoeffs_.get<scalar>("defaultCIn")),
XiEqInFade_(XiEqModelCoeffs_.get<scalar>("XiEqInFade")),
XiEqModel_
(
XiEqModel::New(XiEqModelCoeffs_, modelType, thermo, turbulence, Su)
)
{
if (CIn_ <= 0.0)
{
CIn_ = defaultCIn_;
}
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability2XiEq::XiEq() const
{
IOdictionary combustionProperties
(
IOobject
(
"combustionProperties",
Su_.mesh().time().constant(),
Su_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
ignition ign(combustionProperties, Su_.mesh().time(), Su_.mesh());
//const scalar ignTim = ign.sites()[0].tmIgn();
const scalar curTime = Su_.mesh().time().value();
const scalar deltaT = Su_.mesh().time().deltaTValue();
const scalar ignTim = curTime - deltaT - ign.sites()[0].time();
volScalarField turbXiEq(XiEqModel_->XiEq());
volScalarField XiEqIn1("XiEqIn1", 0.0*turbXiEq);
dimensionedScalar CIn("CIn", dimensionSet(0, -2, 1, 0, 0, 0, 0), CIn_);
dimensionedScalar ignTm("ignTm", dimTime, ignTim);
XiEqIn1 = exp(CIn*Su_*Su_*ignTm) - 1.0;
return
(
1.0 + sqrt(XiEqInFade_*sqr(XiEqIn1) + sqr(turbXiEq - 1.0))
);
}
bool Foam::XiEqModels::instability2XiEq::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.readEntry("defaultCIn", defaultCIn_);
XiEqModelCoeffs_.readEntry("XiEqInFade", XiEqInFade_);
return XiEqModel_->read(XiEqModelCoeffs_);
}
// ************************************************************************* //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,22 +24,25 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::XiEqModels::SCOPEBlend
Foam::XiEqModels::instability2XiEq
Description
Simple SCOPEBlendXiEq model for XiEq based on SCOPEXiEqs correlation
with a linear correction function to give a plausible profile for XiEq.
See \link SCOPELaminarFlameSpeed.H \endlink for details on the SCOPE
laminar flame speed model.
SourceFiles
SCOPEBlend.C
instability2XiEq.C
\*---------------------------------------------------------------------------*/
#ifndef SCOPEBlend_H
#define SCOPEBlend_H
#ifndef instability2XiEq_H
#define instability2XiEq_H
#include "laminarFlameSpeed.H"
#include "SCOPELaminarFlameSpeed.H"
#include "ignitionSite.H"
#include "ignition.H"
#include "Time.H"
#include "fvMesh.H"
#include "XiEqModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,43 +53,53 @@ namespace XiEqModels
{
/*---------------------------------------------------------------------------*\
Class SCOPEBlend Declaration
Class instability2 Declaration
\*---------------------------------------------------------------------------*/
class SCOPEBlend
class instability2XiEq
:
public XiEqModel
{
// Private data
//- Low turbulence intensity equilibrium Xi model
autoPtr<XiEqModel> XiEqModelL_;
//- Laminar burning speed
laminarFlameSpeedModels::SCOPE saModel_;
//- High turbulence intensity equilibrium Xi model
autoPtr<XiEqModel> XiEqModelH_;
//- GIn (initial instability G)divided by Su^2. Read from fuel file
scalar CIn_;
//- Default CIn if not in fuel file
scalar defaultCIn_;
//- Determines how fast XiEqIn fades out as turbulence comes in
scalar XiEqInFade_;
//- Equilibrium Xi model due to all other effects
autoPtr<XiEqModel> XiEqModel_;
// Private Member Functions
//- No copy construct
SCOPEBlend(const SCOPEBlend&) = delete;
instability2XiEq(const instability2XiEq&) = delete;
//- No copy assignment
void operator=(const SCOPEBlend&) = delete;
void operator=(const instability2XiEq&) = delete;
public:
//- Runtime type information
TypeName("SCOPEBlend");
TypeName("instability2XiEq");
// Constructors
//- Construct from components
SCOPEBlend
instability2XiEq
(
const dictionary& XiEqProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -94,7 +107,7 @@ public:
//- Destructor
virtual ~SCOPEBlend();
virtual ~instability2XiEq() = default;
// Member Functions
@ -103,11 +116,7 @@ public:
virtual tmp<volScalarField> XiEq() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties)
{
return true;
}
virtual bool read(const dictionary& XiEqProperties);
};

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,22 +46,17 @@ namespace XiGModels
Foam::XiGModels::KTS::KTS
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
GEtaCoef_(XiGModelCoeffs_.get<scalar>("GEtaCoef"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiGModels::KTS::~KTS()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
@ -74,6 +70,15 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
}
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::Db() const
{
const objectRegistry& db = Su_.db();
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
//return turbulence_.muEff();
return Db1;
}
bool Foam::XiGModels::KTS::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,8 +28,8 @@ Class
Foam::XiGModels::KTS
Description
Simple Kolmogorov time-scale (KTS) model for the flame-wrinling generation
rate.
Simple Kolmogorov time-scale (KTS) model for the flame-wrinkling
generation rate.
SourceFiles
KTS.C
@ -55,7 +56,7 @@ class KTS
:
public XiGModel
{
// Private data
// Private Data
scalar GEtaCoef_;
@ -81,6 +82,7 @@ public:
KTS
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -88,7 +90,7 @@ public:
//- Destructor
virtual ~KTS();
virtual ~KTS() = default;
// Member Functions
@ -96,6 +98,9 @@ public:
//- Return the flame-wrinkling generation rate
virtual tmp<volScalarField> G() const;
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiGProperties);
};

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -41,6 +41,7 @@ namespace Foam
Foam::XiGModel::XiGModel
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -50,7 +51,7 @@ Foam::XiGModel::XiGModel
(
XiGProperties.subDict
(
XiGProperties.get<word>("XiGModel") + "Coeffs"
XiGProperties.get<word>(modelType) + "Coeffs"
)
),
thermo_(thermo),
@ -69,7 +70,7 @@ Foam::XiGModel::~XiGModel()
bool Foam::XiGModel::read(const dictionary& XiGProperties)
{
XiGModelCoeffs_ = XiGProperties.optionalSubDict(type() + "Coeffs");
XiGModelCoeffs_ = XiGProperties.subDict(type() + "Coeffs");
return true;
}

View File

@ -28,9 +28,6 @@ Class
Description
Base-class for all Xi generation models used by the b-Xi combustion model.
See Technical Report SH/RE/01R for details on the PDR modelling. For details
on the use of XiGModel see \link XiModel.H \endlink. The model available is
\link instabilityG.H \endlink
SourceFiles
XiGModel.C
@ -56,10 +53,9 @@ namespace Foam
class XiGModel
{
protected:
// Protected data
// Protected Data
dictionary XiGModelCoeffs_;
@ -68,9 +64,7 @@ protected:
const volScalarField& Su_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
XiGModel(const XiGModel&) = delete;
@ -94,12 +88,14 @@ public:
dictionary,
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
),
(
XiGProperties,
modelType,
thermo,
turbulence,
Su
@ -113,6 +109,7 @@ public:
static autoPtr<XiGModel> New
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -125,6 +122,7 @@ public:
XiGModel
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -137,14 +135,11 @@ public:
// Member Functions
//- Return the flame-wrinkling generation rate
//- Return the flame-wrinkling genration rate
virtual tmp<volScalarField> G() const = 0;
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const
{
return turbulence_.muEff();
}
virtual tmp<volScalarField> Db() const = 0;
//- Update properties from given dictionary
virtual bool read(const dictionary& XiGProperties) = 0;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,14 +33,15 @@ License
Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
(
const dictionary& dict,
const word& modelName,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
{
const word modelType(dict.get<word>("XiGModel"));
const word modelType(dict.get<word>(modelName));
Info<< "Selecting flame-wrinkling model " << modelType << endl;
Info<< "Selecting flame-wrinkling model for G " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
@ -49,13 +50,16 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
FatalIOErrorInLookup
(
dict,
"XiGModel",
modelName,
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalIOError);
}
return autoPtr<XiGModel>(cstrIter()(dict, thermo, turbulence, Su));
return autoPtr<XiGModel>(cstrIter()
(
dict, modelName, thermo, turbulence, Su)
);
}

View File

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "IFstream.H"
#include "instability2G.H"
#include "addToRunTimeSelectionTable.H"
#include "fvCFD.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiGModels
{
defineTypeNameAndDebug(instability2G, 0);
addToRunTimeSelectionTable(XiGModel, instability2G, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiGModels::instability2G::instability2G
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
saModel_
(
IOdictionary
(
IOobject
(
"combustionProperties",
Su.mesh().time().constant(),
Su.mesh(),
IOobject::MUST_READ
)
),
thermo
),
CIn_(saModel_.CIn()),
defaultCIn_(XiGModelCoeffs_.get<scalar>("defaultCIn")),
GInFade_(XiGModelCoeffs_.get<scalar>("GInFade")),
GInMult_(XiGModelCoeffs_.get<scalar>("GInMult")),
lambdaIn_("lambdaIn", XiGModelCoeffs_),
XiGModel_
(
XiGModel::New(XiGModelCoeffs_, modelType, thermo, turbulence, Su)
)
{
if (CIn_ <= 0.0)
{
CIn_ = defaultCIn_;
}
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiGModels::instability2G::G() const
{
IOdictionary combustionProperties
(
IOobject
(
"combustionProperties",
Su_.mesh().time().constant(),
Su_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
ignition ign(combustionProperties, Su_.mesh().time(), Su_.mesh());
scalar curTime = Su_.mesh().time().value();
scalar deltaT = Su_.mesh().time().deltaTValue();
const scalar ignTim = curTime - deltaT - ign.sites()[0].time();
volScalarField turbXiG(XiGModel_->G());
volScalarField GIn("GIn", 0.0*turbXiG);
forAll (GIn, i)
{
GIn[i] = CIn_*Su_[i]*Su_[i]*exp(CIn_*Su_[i]*Su_[i]*ignTim)*GInMult_;
}
dimensionedScalar CIn("CIn", dimensionSet(0, -2, 1, 0, 0, 0, 0), CIn_);
dimensionedScalar ignTm("ignTm", dimTime, ignTim);
GIn = CIn*Su_*Su_*exp(CIn*Su_*Su_*ignTm)*GInMult_;
GIn *=
(
GIn /
(
GIn
+ GInFade_*turbXiG
+ dimensionedScalar("GSmall", inv(dimTime), SMALL)
)
);
return (GIn + turbXiG);
}
Foam::tmp<Foam::volScalarField> Foam::XiGModels::instability2G::Db() const
{
const objectRegistry& db = Su_.db();
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
//return turbulence_.muEff()
return Db1
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
}
bool Foam::XiGModels::instability2G::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.readEntry("defaultCIn", defaultCIn_);
XiGModelCoeffs_.readEntry("GInFade", GInFade_);
XiGModelCoeffs_.readEntry("GInMult", GInMult_);
XiGModelCoeffs_.readEntry("lambdaIn", lambdaIn_);
return true;
}
// ************************************************************************* //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,106 +24,115 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::XiModels::algebraic
Foam::XiGModels::instability2G
Description
Simple algebraic model for Xi based on Gulders correlation
with a linear correction function to give a plausible profile for Xi.
See report TR/HGW/10 for details on the Weller two equations model.
See \link XiModel.H \endlink for more details on flame wrinkling modelling.
Flame-surface instabilityG flame-wrinkling generation rate coefficient model
used in \link XiModel.H \endlink.
SourceFiles
algebraic.C
instability2G.C
\*---------------------------------------------------------------------------*/
#ifndef algebraic_H
#define algebraic_H
#ifndef instability2G_H
#define instability2G_H
#include "XiModel.H"
#include "XiEqModel.H"
#include "laminarFlameSpeed.H"
#include "SCOPELaminarFlameSpeed.H"
#include "XiGModel.H"
#include "ignitionSite.H"
#include "ignition.H"
#include "Time.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
namespace XiGModels
{
/*---------------------------------------------------------------------------*\
Class algebraic Declaration
Class instability2G Declaration
\*---------------------------------------------------------------------------*/
class algebraic
class instability2G
:
public XiModel
public XiGModel
{
// Private data
// Private Data
scalar XiShapeCoef;
laminarFlameSpeedModels::SCOPE saModel_;
autoPtr<XiEqModel> XiEqModel_;
// GIn (inituial instability G)divided by Su^2. Read from fuel file
scalar CIn_;
//- Default CIn if not in fuel file
scalar defaultCIn_;
// Determine how fast GIn fades out as turbulence starts
scalar GInFade_;
// Set GIn large so that XiEq determines Xi value.
// Son increase byfactor:
scalar GInMult_;
//- The instability2G length-scale
dimensionedScalar lambdaIn_;
//- Xi generation rate model due to all other processes
autoPtr<XiGModel> XiGModel_;
// Private Member Functions
//- No copy construct
algebraic(const algebraic&) = delete;
instability2G(const instability2G&) = delete;
//- No copy assignment
void operator=(const algebraic&) = delete;
void operator=(const instability2G&) = delete;
public:
//- Runtime type information
TypeName("algebraic");
TypeName("instability2G");
// Constructors
//- Construct from components
algebraic
instability2G
(
const dictionary& XiProperties,
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
const volScalarField& Su
);
//- Destructor
virtual ~algebraic();
virtual ~instability2G() = default;
// Member Functions
//- Return the flame-wrinkling generation rate
virtual tmp<volScalarField> G() const;
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const;
//- Correct the flame-wrinkling Xi
virtual void correct();
//- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties);
//- Write fields of the XiEq model
virtual void writeFields()
{
XiEqModel_().writeFields();
}
virtual bool read(const dictionary& XiGProperties);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace XiModels
} // End namespace XiGModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,21 +45,16 @@ namespace XiGModels
Foam::XiGModels::instabilityG::instabilityG
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
GIn_("GIn", dimless/dimTime, XiGModelCoeffs_),
lambdaIn_("lambdaIn", dimLength, XiGModelCoeffs_),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiGModels::instabilityG::~instabilityG()
XiGModel(XiGProperties, modelType, thermo, turbulence, Su),
GIn_("GIn", XiGModelCoeffs_),
lambdaIn_("lambdaIn", XiGModelCoeffs_),
XiGModel_(XiGModel::New(XiGModelCoeffs_,modelType,thermo, turbulence, Su))
{}
@ -76,11 +71,14 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::Db() const
{
const objectRegistry& db = Su_.db();
const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
const volScalarField& Xp = db.lookupObject<volScalarField>("Xp");
const volScalarField& rho = db.lookupObject<volScalarField>("rho");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
return XiGModel_->Db()
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
//// OLD return turbulence_.muEff()
return Db1
+ rho*Su_*(Xp*Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,8 +31,6 @@ Description
Flame-surface instabilityG flame-wrinkling generation rate coefficient model
used in \link XiModel.H \endlink.
See Technical Report SH/RE/01R for details on the PDR modelling.
SourceFiles
instabilityG.C
@ -57,9 +56,9 @@ class instabilityG
:
public XiGModel
{
// Private data
// Private Data
//- Flame instabilityG wrinkling generation rate coefficient
//- Flame instabilityG wrinling generation rate coefficient
dimensionedScalar GIn_;
//- InstabilityG length-scale
@ -90,6 +89,7 @@ public:
instabilityG
(
const dictionary& XiGProperties,
const word& modelType,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su
@ -97,7 +97,7 @@ public:
//- Destructor
virtual ~instabilityG();
virtual ~instabilityG() = default;
// Member Functions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -73,7 +73,19 @@ Foam::XiModel::XiModel
IOobject::AUTO_WRITE
),
b.mesh()
)
),
Xp_
(
IOobject
(
"Xp",
b.time().timeName(),
b.db(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
b.mesh()
)
{}

View File

@ -95,8 +95,8 @@ SourceFiles
#include "IOdictionary.H"
#include "psiuReactionThermo.H"
#include "turbulentFluidThermoModel.H"
#include "multivariateSurfaceInterpolationScheme.H"
#include "fvcDiv.H"
#include "multivariateSurfaceInterpolationScheme.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -110,10 +110,9 @@ namespace Foam
class XiModel
{
protected:
// Protected data
// Protected Data
dictionary XiModelCoeffs_;
@ -127,10 +126,11 @@ protected:
//- Flame wrinkling field
volScalarField Xi_;
//- Flame wrinkling field for the subgrid obstacles
volScalarField Xp_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
XiModel(const XiModel&) = delete;
@ -215,19 +215,31 @@ public:
return Xi_;
}
//- Return the obstacle-flame-wrinkling Xp
virtual const volScalarField& Xp() const
{
return Xp_;
}
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const
{
return turbulence_.muEff();
const objectRegistry& db = Su_.db();
const volScalarField& Db1 = db.lookupObject<volScalarField>("Db");
//return turbulence_.muEff();
return Db1;
}
//- Add Xi to the multivariateSurfaceInterpolationScheme table
// if required
virtual void addXi
void addXi
(
multivariateSurfaceInterpolationScheme<scalar>::fieldTable&
multivariateSurfaceInterpolationScheme<scalar>::fieldTable& fields
)
{}
{
fields.add(Xi_);
fields.add(Xp_);
}
//- Correct the flame-wrinkling Xi
virtual void correct() = 0;

View File

@ -1,100 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "algebraic.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
defineTypeNameAndDebug(algebraic, 0);
addToRunTimeSelectionTable(XiModel, algebraic, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiModels::algebraic::algebraic
(
const dictionary& XiProperties,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiModels::algebraic::~algebraic()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiModels::algebraic::Db() const
{
return XiGModel_->Db();
}
void Foam::XiModels::algebraic::correct()
{
volScalarField XiEqEta(XiEqModel_->XiEq());
volScalarField GEta(XiGModel_->G());
volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999));
volScalarField XiEqStar(R/(R - GEta));
Xi_ == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0);
}
bool Foam::XiModels::algebraic::read(const dictionary& XiProperties)
{
XiModel::read(XiProperties);
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef);
return true;
}
// ************************************************************************* //

View File

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "transport.H"
#include "surfaceInterpolate.H"
#include "fvmDdt.H"
#include "fvcLaplacian.H"
#include "fvmDiv.H"
#include "fvmSup.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
defineTypeNameAndDebug(transport, 0);
addToRunTimeSelectionTable(XiModel, transport, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiModels::transport::transport
(
const dictionary& XiProperties,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiModels::transport::~transport()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiModels::transport::Db() const
{
return XiGModel_->Db();
}
void Foam::XiModels::transport::correct
(
const fv::convectionScheme<scalar>& mvConvection
)
{
volScalarField XiEqEta(XiEqModel_->XiEq());
volScalarField GEta(XiGModel_->G());
volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999));
volScalarField XiEqStar(R/(R - GEta));
volScalarField XiEq
(
1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0)
);
volScalarField G(R*(XiEq - 1.0)/XiEq);
const objectRegistry& db = b_.db();
const volScalarField& betav = db.lookupObject<volScalarField>("betav");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const surfaceScalarField& phiSt =
db.lookupObject<surfaceScalarField>("phiSt");
const volScalarField& Db = db.lookupObject<volScalarField>("Db");
const surfaceScalarField& nf = db.lookupObject<surfaceScalarField>("nf");
surfaceScalarField phiXi
(
"phiXi",
phiSt
+ (
- fvc::interpolate(fvc::laplacian(Db, b_)/mgb)*nf
+ fvc::interpolate(rho_)*fvc::interpolate(Su_*(1.0/Xi_ - Xi_))*nf
)
);
solve
(
betav*fvm::ddt(rho_, Xi_)
+ mvConvection.fvmDiv(phi_, Xi_)
+ fvm::div(phiXi, Xi_)
- fvm::Sp(fvc::div(phiXi), Xi_)
==
betav*rho_*R
- fvm::Sp(betav*rho_*(R - G), Xi_)
);
// Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~
Xi_.max(1.0);
Xi_ = min(Xi_, 2.0*XiEq);
}
bool Foam::XiModels::transport::read(const dictionary& XiProperties)
{
XiModel::read(XiProperties);
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef);
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,258 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "transportTwoEqs.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace XiModels
{
defineTypeNameAndDebug(transportTwoEqs, 0);
addToRunTimeSelectionTable(XiModel, transportTwoEqs, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::XiModels::transportTwoEqs::transportTwoEqs
(
const dictionary& XiProperties,
const psiuReactionThermo& thermo,
const compressible::RASModel& turbulence,
const volScalarField& Su,
const volScalarField& rho,
const volScalarField& b,
const surfaceScalarField& phi
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef_(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
CpfiDot_(XiModelCoeffs_.get<scalar>("CpfiDot")),
CpfiCross_(XiModelCoeffs_.get<scalar>("CpfiCross")),
GEtaExp_(XiModelCoeffs_.get<scalar>("GEtaExp")),
LOverCw_(XiModelCoeffs_.get<scalar>("LOverCw")),
XiEqModel_
(
XiEqModel::New(XiProperties, "XiEqModel", thermo, turbulence, Su)
),
XiGModel_(XiGModel::New(XiProperties, "XiGModel", thermo, turbulence, Su)),
XpEqModel_
(
XiEqModel::New(XiProperties, "XpEqModel", thermo, turbulence, Su)
),
XpGModel_
(
XiGModel::New(XiProperties, "XpGModel", thermo, turbulence, Su)
),
Ep_
(
IOobject
(
"Ep",
b.time().timeName(),
b.db(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
b.mesh()
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::XiModels::transportTwoEqs::~transportTwoEqs()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::XiModels::transportTwoEqs::Db() const
{
return XiGModel_->Db();
}
void Foam::XiModels::transportTwoEqs::correct
(
const fv::convectionScheme<scalar>& mvConvection
)
{
const volScalarField XiEqEta(XiEqModel_->XiEq());
volScalarField GEta(XiGModel_->G());
GEta *= max( 1.0, exp( GEtaExp_*(1.0 - (Xi_ - 1.0)/(XiEqEta - 0.999)))) ;
const volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999));
const volScalarField XiEqStar(R/(R - GEta));
const volScalarField XiEq
(
1.0 + (1.0 + (2*XiShapeCoef_)*(0.5 - b_))*(XiEqStar - 1.0)
);
const volScalarField G(R*(XiEq - 1.0)/XiEq);
const objectRegistry& db = b_.db();
const volScalarField& betav = db.lookupObject<volScalarField>("betav");
const volScalarField& p = db.lookupObject<volScalarField>("p");
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
const surfaceScalarField& phiSt =
db.lookupObject<surfaceScalarField>("phiSt");
const volScalarField& Db = db.lookupObject<volScalarField>("Db");
const surfaceScalarField& nf = db.lookupObject<surfaceScalarField>("nf");
surfaceScalarField phiXi
(
"phiXi",
phiSt
+ (
- fvc::interpolate(fvc::laplacian(Db, b_)/mgb)*nf
+ fvc::interpolate(rho_)
* fvc::interpolate(Su_*(1.0/(Xi_*Xp_) - (Xi_*Xp_)))*nf
)
);
dimensionedScalar zero
(
"zero",
dimensionSet(2, -6, -2, 0, 0, 0, 0),
scalar(0.0)
);
const volScalarField Gpfi
(
CpfiDot_
* sqrt(max(fvc::grad(rho_)&fvc::grad(p), zero))
/ rho_*b_*(1.0-b_)
+ CpfiCross_
* sqrt(mag(fvc::grad(rho_)^fvc::grad(p)))
/ rho_*b_*(1.0-b_)
);
fvScalarMatrix XiEqn_
(
betav*fvm::ddt(rho_, Xi_)
+ mvConvection.fvmDiv(phi_, Xi_)
+ fvm::div(phiXi, Xi_)
- fvm::Sp(fvc::div(phiXi), Xi_)
==
betav*rho_*(R + Gpfi )
- fvm::Sp(betav*rho_*(R - G), Xi_)
);
XiEqn_.relax();
XiEqn_.solve();
// Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~
Xi_.max(1.0);
Xi_ = min(Xi_, 2.0*XiEq);
// Calculation of Xp generated by obstacles
volScalarField XpEqEta("XpEqEta",XpEqModel_->XiEq());
const volScalarField GpEta("GpEta", XpGModel_->G());
const volScalarField Rp("Rp", GpEta*XpEqEta/(XpEqEta - 0.999));
const volScalarField XpEq
(
"XpEq",
1.0 + (1.0 + (2*XiShapeCoef_)*(0.5 - b_))*(XpEqEta - 1.0)
);
const volScalarField Gpp("Gpp", Rp*(XpEq - 1.0)/XpEq);
fvScalarMatrix XpEqn_
(
betav*fvm::ddt(rho_, Xp_)
+ mvConvection.fvmDiv(phi_, Xp_)
+ fvm::div(phiXi, Xp_)
- fvm::Sp(fvc::div(phiXi), Xp_)
==
betav*rho_*Rp
- fvm::Sp(betav*rho_*(Rp - Gpp), Xp_)
);
XpEqn_.relax();
XpEqn_.solve();
Xp_.max(1.0);
Xp_ = min(Xp_, 20.0*XpEq);
// Calculate Ep
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
const scalarField Cw(pow(Su_.mesh().V(), 2.0/3.0));
volScalarField LI(Lobs);
LI.primitiveFieldRef() = max(LI.primitiveField(),LOverCw_*sqrt(Cw));
fvScalarMatrix EpEqn_
(
betav*fvm::ddt(rho_, Ep_)
+ mvConvection.fvmDiv(phi_, Ep_)
+ fvm::div(phiXi, Ep_)
- fvm::Sp(fvc::div(phiXi), Ep_)
==
betav*rho_*Gpp*Xp_/LI
- fvm::Sp(betav*rho_*Rp, Ep_)
);
EpEqn_.relax();
EpEqn_.solve();
Ep_.max(0.0);
Ep_.min(100000.0);
}
bool Foam::XiModels::transportTwoEqs::read(const dictionary& XiProperties)
{
XiModel::read(XiProperties);
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef_);
XiModelCoeffs_.readEntry("CpfiDot", CpfiDot_);
XiModelCoeffs_.readEntry("CpfiCross", CpfiCross_);
XiModelCoeffs_.readEntry("GEtaExp", GEtaExp_);
return true;
}
// ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,21 +25,17 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::XiModels::transport
Foam::XiModels::transportTwoEqs
Description
Simple transport model for Xi based on Gulders correlation
with a linear correction function to give a plausible profile for Xi.
See report TR/HGW/10 for details on the Weller two equations model.
See \link XiModel.H \endlink for more details on flame wrinkling modelling.
SourceFiles
transport.C
transportTwoEqs.C
\*---------------------------------------------------------------------------*/
#ifndef transport_H
#define transport_H
#ifndef transportTwoEqs_H
#define transportTwoEqs_H
#include "XiModel.H"
#include "XiEqModel.H"
@ -52,40 +49,58 @@ namespace XiModels
{
/*---------------------------------------------------------------------------*\
Class transport Declaration
Class transportTwoEqs Declaration
\*---------------------------------------------------------------------------*/
class transport
class transportTwoEqs
:
public XiModel
{
// Private data
scalar XiShapeCoef;
scalar XiShapeCoef_;
scalar CpfiDot_;
scalar CpfiCross_;
scalar GEtaExp_;
//- Maximum Lobs/CellWidth
scalar LOverCw_;
//- Equilibrium for Xi (turbulence)
autoPtr<XiEqModel> XiEqModel_;
//- Generation for Xi (turbulence)
autoPtr<XiGModel> XiGModel_;
//- Equilibrium for Xp (obstacles)
autoPtr<XiEqModel> XpEqModel_;
//- Generation for Xp (obstacles)
autoPtr<XiGModel> XpGModel_;
//- Dissipation length scale for subgrid obstacles
volScalarField Ep_;
// Private Member Functions
//- No copy construct
transport(const transport&) = delete;
transportTwoEqs(const transportTwoEqs&) = delete;
//- No copy assignment
void operator=(const transport&) = delete;
void operator=(const transportTwoEqs&) = delete;
public:
//- Runtime type information
TypeName("transport");
TypeName("transportTwoEqs");
// Constructors
//- Construct from components
transport
transportTwoEqs
(
const dictionary& XiProperties,
const psiuReactionThermo& thermo,
@ -98,7 +113,7 @@ public:
//- Destructor
virtual ~transport();
virtual ~transportTwoEqs();
// Member Functions
@ -106,15 +121,6 @@ public:
//- Return the flame diffusivity
virtual tmp<volScalarField> Db() const;
//- Add Xi to the multivariateSurfaceInterpolationScheme table
virtual void addXi
(
multivariateSurfaceInterpolationScheme<scalar>::fieldTable& fields
)
{
fields.add(Xi_);
}
//- Correct the flame-wrinkling Xi
virtual void correct()
{
@ -131,6 +137,7 @@ public:
virtual void writeFields()
{
XiEqModel_().writeFields();
XpEqModel_().writeFields();
}
};

View File

@ -5,11 +5,20 @@ tmp<fv::convectionScheme<scalar>> mvConvection
mesh,
fields,
phi,
mesh.divScheme("div(phi,ft_b_ha_hau)")
mesh.divScheme("div(phi,ft_b_h_hu)")
)
);
volScalarField Db("Db", turbulence->muEff());
rhou = thermo.rhou();
muu = thermo.muu();
volScalarField Db("Db", turbulence->mut());
const volScalarField DbThermal
(
"DbAlpha",
turbulence->alphaEff()
//thermo.alpha() + turbulence->mut()/Prt
);
if (ign.ignited())
{
@ -17,30 +26,31 @@ if (ign.ignited())
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Su = unstrainedLaminarFlameSpeed()();
// Wrinkling due to turbulence
const volScalarField& Xi = flameWrinkling->Xi();
// progress variable
// ~~~~~~~~~~~~~~~~~
volScalarField c("c", 1.0 - b);
// Wrinkling due to obstacles
const volScalarField& Xp = flameWrinkling->Xp();
// Progress variable
// ~~~~~~~~~~~~~~~~~
c = (1.0 - b);
// Unburnt gas density
// ~~~~~~~~~~~~~~~~~~~
volScalarField rhou(thermo.rhou());
// Calculate flame normal etc.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//volVectorField n(fvc::grad(b));
volVectorField n(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf()));
volScalarField mgb("mgb", mag(n));
volScalarField ddtb("ddtb",fvc::ddt(b));
dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL);
{
volScalarField bc(b*c);
dMgb += 1.0e-3*
dMgb += 1.0e-8*
(bc*mgb)().weightedAverage(mesh.V())
/(bc.weightedAverage(mesh.V()) + SMALL);
}
@ -54,6 +64,7 @@ if (ign.ignited())
surfaceScalarField nf("nf", mesh.Sf() & nfVec);
n /= mgb;
#include "StCorr.H"
// Calculate turbulent flame speed flux
@ -64,8 +75,6 @@ if (ign.ignited())
Db = flameWrinkling->Db();
// Create b equation
// ~~~~~~~~~~~~~~~~~
fvScalarMatrix bEqn
(
betav*fvm::ddt(rho, b)
@ -75,6 +84,7 @@ if (ign.ignited())
- fvm::laplacian(Db, b)
==
betav*fvOptions(rho, b)
// + betav*rhou*St*StCorr*mag(fvc::grad(b))
);
@ -82,17 +92,16 @@ if (ign.ignited())
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "ignite.H"
// Solve for b
// ~~~~~~~~~~~
bEqn.relax();
fvOptions.constrain(bEqn);
bEqn.solve();
b.max(0.0);
b.min(1.0);
fvOptions.correct(b);
Info<< "min(b) = " << min(b).value() << endl;
Info<< "min(b) = " << min(b).value() << nl
<< "max(b) = " << max(b).value() << endl;
if (composition.contains("ft"))
{
@ -109,8 +118,14 @@ if (ign.ignited())
<< endl;
}
// Correct the flame-wrinkling
flameWrinkling->correct(mvConvection);
St = Xi*Su;
// Correct the flame-wrinkling, smoothing
flameWrinkling->correct(mvConvection);
St = Xp*Xi*Su*combustFlag;
if (PDRProperties.getOrDefault("smoothSt", false))
{
const scalar coeff = PDRProperties.get<scalar>("smoothStCoeff");
fvc::smooth(St, coeff);
}
}

View File

@ -1 +1,2 @@
const volScalarField& psi = thermo.psi();
scalar pMin = thermo.getOrDefault<scalar>("pMin", 0);

View File

@ -1,218 +1,303 @@
Info<< "Reading thermophysical properties\n" << endl;
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiuReactionThermo> pThermo
(
psiuReactionThermo::New(mesh)
);
psiuReactionThermo& thermo = pThermo();
thermo.validate(args.executable(), "ha", "ea");
basicSpecieMixture& composition = thermo.composition();
volScalarField rho
(
IOobject
autoPtr<psiuReactionThermo> pThermo
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
psiuReactionThermo::New(mesh)
);
psiuReactionThermo& thermo = pThermo();
thermo.validate(args.executable(), "ha", "ea");
basicMultiComponentMixture& composition = thermo.composition();
volScalarField& p = thermo.p();
volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl;
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
volScalarField rho
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::New<compressible::RASModel>
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
volScalarField rhou
(
IOobject
(
"rhou",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rhou()
);
volScalarField muu
(
IOobject
(
"muu",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.muu()
);
volScalarField& p = thermo.p();
volScalarField& b = composition.Y("b");
volScalarField combustFlag
(
IOobject
(
"combustFlag",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading fields betav, betai\n" << endl;
volScalarField betav
(
IOobject
(
"betav",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
volSymmTensorField betai
(
IOobject
(
"betai",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading field Bv\n" << endl;
volSymmTensorField Bv
(
IOobject
(
"Bv",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading fields Nv,nsv\n" << endl;
volScalarField Nv
(
IOobject
(
"Nv",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
volSymmTensorField nsv
(
IOobject
(
"nsv",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading fields Blong\n" << endl;
volSymmTensorField Blong
(
IOobject
(
"Blong",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "\nCreating field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::New<compressible::RASModel>
(
rho,
U,
phi,
thermo
)
);
#include "createDpdt.H"
#include "createK.H"
Info<< "Creating the unstrained laminar flame speed\n" << endl;
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
(
laminarFlameSpeed::New(thermo)
);
Info<< "Reading strained laminar flame speed field Su\n" << endl;
volScalarField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field Lobs\n" << endl;
volScalarField Lobs
(
IOobject
(
"Lobs",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading field CT\n" << endl;
volSymmTensorField CT
(
IOobject
(
"CT",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
IOdictionary PDRProperties
(
IOobject
(
"PDRProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
//- Create the drag model
autoPtr<PDRDragModel> drag = PDRDragModel::New
(
PDRProperties,
turbulence,
rho,
U,
phi,
thermo
)
);
phi
);
Info<< "Creating the unstrained laminar flame speed\n" << endl;
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
(
laminarFlameSpeed::New(thermo)
);
Info<< "Reading strained laminar flame speed field Su\n" << endl;
volScalarField Su
(
IOobject
//- Create the flame-wrinkling model
autoPtr<XiModel> flameWrinkling = XiModel::New
(
"Su",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
PDRProperties,
thermo,
turbulence,
Su,
rho,
b,
phi
);
Info<< "Reading field betav\n" << endl;
volScalarField betav
(
IOobject
Info<< "Calculating turbulent flame speed field St\n" << endl;
volScalarField St
(
"betav",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
IOobject
(
"St",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
flameWrinkling->Xi()*Su
);
Info<< "Reading field Lobs\n" << endl;
volScalarField Lobs
(
IOobject
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft"))
{
fields.add(composition.Y("ft"));
}
fields.add(b);
fields.add(thermo.he());
fields.add(thermo.heu());
flameWrinkling->addXi(fields);
#include "createMRF.H"
#include "createFvOptions.H"
volScalarField c
(
"Lobs",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading field CT\n" << endl;
volSymmTensorField CT
(
IOobject
(
"CT",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading field Nv\n" << endl;
volScalarField Nv
(
IOobject
(
"Nv",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading field nsv\n" << endl;
volSymmTensorField nsv
(
IOobject
(
"nsv",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
IOdictionary PDRProperties
(
IOobject
(
"PDRProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
//- Create the drag model
autoPtr<PDRDragModel> drag = PDRDragModel::New
(
PDRProperties,
*turbulence,
rho,
U,
phi
);
//- Create the flame-wrinkling model
autoPtr<XiModel> flameWrinkling = XiModel::New
(
PDRProperties,
thermo,
*turbulence,
Su,
rho,
b,
phi
);
Info<< "Calculating turbulent flame speed field St\n" << endl;
volScalarField St
(
IOobject
(
"St",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
flameWrinkling->Xi()*Su
);
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
if (composition.contains("ft"))
{
fields.add(composition.Y("ft"));
}
fields.add(b);
fields.add(thermo.he());
fields.add(thermo.heu());
flameWrinkling->addXi(fields);
#include "createDpdt.H"
#include "createK.H"
#include "createMRF.H"
#include "createFvOptions.H"
IOobject
(
"c",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
scalar(1) - b
);

View File

@ -5,7 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -47,6 +48,34 @@ namespace laminarFlameSpeedModels
}
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
namespace Foam
{
static void readPolynomialCoeffs
(
Polynomial<7>& coeffs,
const word& keyword,
const dictionary& dict
)
{
{
coeffs[0] = dict.get<scalar>(keyword + "0");
coeffs[1] = dict.get<scalar>(keyword + "1");
coeffs[2] = dict.get<scalar>(keyword + "2");
coeffs[3] = dict.get<scalar>(keyword + "3");
coeffs[4] = dict.get<scalar>(keyword + "4");
coeffs[5] = dict.get<scalar>(keyword + "5");
coeffs[6] = dict.get<scalar>(keyword + "6");
}
// TBD: support direct reading of all coeffs?
}
} // End namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarFlameSpeedModels::SCOPE::polynomial::polynomial
@ -75,35 +104,22 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
(
dictionary
(
IFstream
(
dict.get<fileName>("fuelFile")
)()
).optionalSubDict(typeName + "Coeffs")
),
LFL_
(
coeffsDict_.getCompat<scalar>
(
"lowerFlammabilityLimit",
{{"lowerFlamabilityLimit", 1712}}
)
),
UFL_
(
coeffsDict_.getCompat<scalar>
(
"upperFlammabilityLimit",
{{"upperFlamabilityLimit", 1712}}
)
IFstream(dict.get<fileName>("fuelFile"))()
).subDict(typeName + "Coeffs")
),
LFL_(coeffsDict_.get<scalar>("lowerFlamabilityLimit")),
UFL_(coeffsDict_.get<scalar>("upperFlamabilityLimit")),
SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")),
SuPolyU_(coeffsDict_.subDict("upperSuPolynomial")),
Texp_(coeffsDict_.get<scalar>("Texp")),
pexp_(coeffsDict_.get<scalar>("pexp")),
Texp_(),
pexp_(),
CIn_(coeffsDict_.getOrDefault<scalar>("CIn", 0)),
MaPolyL_(coeffsDict_.subDict("lowerMaPolynomial")),
MaPolyU_(coeffsDict_.subDict("upperMaPolynomial"))
{
readPolynomialCoeffs(Texp_, "Texp", coeffsDict_);
readPolynomialCoeffs(pexp_, "pexp", coeffsDict_);
SuPolyL_.ll = max(SuPolyL_.ll, LFL_) + SMALL;
SuPolyU_.ul = min(SuPolyU_.ul, UFL_) - SMALL;
@ -116,7 +132,7 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
if (debug)
{
Info<< "phi Su (T = Tref, p = pref)" << endl;
label n = 200;
const label n = 200;
for (int i=0; i<n; i++)
{
scalar phi = (2.0*i)/n;
@ -140,7 +156,7 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::polyPhi
const polynomial& a
)
{
scalar x = phi - 1.0;
const scalar x = phi - 1.0;
return
a[0]
@ -195,28 +211,34 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::SuRef
}
}
inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::Ma
(
scalar phi
) const
{
if (phi < MaPolyL_.ll)
if (phi < LFL_ || phi > UFL_)
{
// Beyond the lower limit assume Ma is constant
return MaPolyL_.llv;
// Return 0 beyond the flamibility limits
return scalar(0);
}
else if (phi < MaPolyL_.ll)
{
// Use linear interpolation between the low end of the
// lower polynomial and the lower flammability limit
return MaPolyL_.llv*(phi - LFL_)/(MaPolyL_.ll - LFL_);
}
else if (phi > MaPolyU_.ul)
{
// Beyond the upper limit assume Ma is constant
return MaPolyU_.ulv;
// Use linear interpolation between the upper end of the
// upper polynomial and the upper flammability limit
return MaPolyU_.ulv*(UFL_ - phi)/(UFL_ - MaPolyU_.ul);
}
else if (phi < SuPolyL_.lu)
else if (phi < MaPolyL_.lu)
{
// Evaluate the lower polynomial
return polyPhi(phi, MaPolyL_);
}
else if (phi > SuPolyU_.lu)
else if (phi > MaPolyU_.lu)
{
// Evaluate the upper polynomial
return polyPhi(phi, MaPolyU_);
@ -241,10 +263,13 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
scalar phi
) const
{
static const scalar Tref = 300.0;
static const scalar pRef = 1.013e5;
constexpr scalar Tref = 300.0;
constexpr scalar pRef = 1.013e5;
return SuRef(phi)*pow((Tu/Tref), Texp_)*pow((p/pRef), pexp_);
const scalar Texp = Texp_.value(phi-1.0);
const scalar pexp = pexp_.value(phi-1.0);
return SuRef(phi)*pow((Tu/Tref), Texp)*pow((p/pRef), pexp);
}
@ -255,35 +280,29 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
scalar phi
) const
{
tmp<volScalarField> tSu0
auto tSu0 = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi);
}
volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
forAll(Su0Bf, patchi)
forAll(Su0.boundaryField(), patchi)
{
scalarField& Su0p = Su0Bf[patchi];
scalarField& Su0p = Su0.boundaryFieldRef()[patchi];
const scalarField& pp = p.boundaryField()[patchi];
const scalarField& Tup = Tu.boundaryField()[patchi];
@ -304,35 +323,29 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
const volScalarField& phi
) const
{
tmp<volScalarField> tSu0
auto tSu0 = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli]);
}
volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
forAll(Su0Bf, patchi)
forAll(Su0.boundaryField(), patchi)
{
scalarField& Su0p = Su0Bf[patchi];
scalarField& Su0p = Su0.boundaryFieldRef()[patchi];
const scalarField& pp = p.boundaryField()[patchi];
const scalarField& Tup = Tu.boundaryField()[patchi];
const scalarField& phip = phi.boundaryField()[patchi];
@ -353,40 +366,40 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
}
Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::CIn() const noexcept
{
return CIn_ ;
}
Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
(
const volScalarField& phi
) const
{
tmp<volScalarField> tMa
auto tMa = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Ma",
phi.time().timeName(),
phi.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
phi.mesh(),
dimensionedScalar(dimless, Zero)
)
"Ma",
phi.time().timeName(),
phi.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
phi.mesh(),
dimensionedScalar(dimless, Zero)
);
volScalarField& ma = tMa.ref();
auto& ma = tMa.ref();
forAll(ma, celli)
{
ma[celli] = Ma(phi[celli]);
}
volScalarField::Boundary& maBf = ma.boundaryFieldRef();
forAll(maBf, patchi)
forAll(ma.boundaryField(), patchi)
{
scalarField& map = maBf[patchi];
scalarField& map = ma.boundaryFieldRef()[patchi];
const scalarField& phip = phi.boundaryField()[patchi];
forAll(map, facei)
@ -410,7 +423,8 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
(
dimensionedScalar
(
"stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_
"stoichiometricAirFuelMassRatio",
psiuReactionThermo_
)*ft/(scalar(1) - ft)
);
}
@ -418,21 +432,18 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
{
const fvMesh& mesh = psiuReactionThermo_.p().mesh();
return tmp<volScalarField>
return tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Ma",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Ma",
mesh.time().timeName(),
mesh,
dimensionedScalar("Ma", dimless, Ma(equivalenceRatio_))
)
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("Ma", dimless, Ma(equivalenceRatio_))
);
}
}
@ -451,7 +462,8 @@ Foam::laminarFlameSpeedModels::SCOPE::operator()() const
psiuReactionThermo_.Tu(),
dimensionedScalar
(
"stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_
"stoichiometricAirFuelMassRatio",
psiuReactionThermo_
)*ft/(scalar(1) - ft)
);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2012 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -65,6 +66,7 @@ SourceFiles
#define SCOPE_H
#include "laminarFlameSpeed.H"
#include "Polynomial.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -105,7 +107,7 @@ class SCOPE
scalar lu;
//- Construct from dictionary
polynomial(const dictionary& polyDict);
explicit polynomial(const dictionary& polyDict);
};
@ -123,11 +125,14 @@ class SCOPE
//- Upper Su polynomial
polynomial SuPolyU_;
//- Temperature correction exponent
scalar Texp_;
//- Temperature correction exponents
Polynomial<7> Texp_;
//- Pressure correction exponent
scalar pexp_;
//- Pressure correction exponents
Polynomial<7> pexp_;
//- Additional coefficient
scalar CIn_;
//- Lower Ma polynomial
polynomial MaPolyL_;
@ -136,25 +141,25 @@ class SCOPE
polynomial MaPolyU_;
// Private member functions
// Private Member Functions
//- Polynomial evaluated from the given equivalence ratio
// and polynomial coefficients
//- and polynomial coefficients
static inline scalar polyPhi(scalar phi, const polynomial& a);
//- Laminar flame speed evaluated from the given equivalence ratio
// at the reference temperature and pressure
//- at the reference temperature and pressure
inline scalar SuRef(scalar phi) const;
//- Markstein evaluated from the given equivalence ratio
inline scalar Ma(scalar phi) const;
//- Laminar flame speed evaluated from the given equivalence ratio
// corrected for temperature and pressure dependence
//- corrected for temperature and pressure dependence
inline scalar Su0pTphi(scalar p, scalar Tu, scalar phi) const;
//- Laminar flame speed evaluated from the given uniform
// equivalence ratio corrected for temperature and pressure dependence
//- equivalence ratio corrected for temperature and pressure dependence
tmp<volScalarField> Su0pTphi
(
const volScalarField& p,
@ -163,7 +168,7 @@ class SCOPE
) const;
//- Laminar flame speed evaluated from the given equivalence ratio
// distribution corrected for temperature and pressure dependence
//- distribution corrected for temperature and pressure dependence
tmp<volScalarField> Su0pTphi
(
const volScalarField& p,
@ -172,13 +177,14 @@ class SCOPE
) const;
//- Return the Markstein number
// evaluated from the given equivalence ratio
//- evaluated from the given equivalence ratio
tmp<volScalarField> Ma(const volScalarField& phi) const;
//- Construct as copy (not implemented)
SCOPE(const SCOPE&);
//- No copy construct
SCOPE(const SCOPE&) = delete;
void operator=(const SCOPE&);
//- No copy assignment
void operator=(const SCOPE&) = delete;
public:
@ -191,8 +197,8 @@ public:
//- Construct from dictionary and psiuReactionThermo
SCOPE
(
const dictionary&,
const psiuReactionThermo&
const dictionary& dict,
const psiuReactionThermo& ct
);
@ -202,6 +208,9 @@ public:
// Member functions
//- Return CIn
scalar CIn() const noexcept;
//- Return the Markstein number
tmp<volScalarField> Ma() const;

View File

@ -1,6 +1,7 @@
rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(invA & UEqn.H(), U, p));
if (pimple.transonic())
@ -8,12 +9,7 @@ if (pimple.transonic())
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
fvc::flux(HbyA)
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
/fvc::interpolate(rho)
)
fvc::interpolate(psi)*(fvc::flux(HbyA))
);
while (pimple.correctNonOrthogonal())
@ -40,10 +36,7 @@ else
surfaceScalarField phiHbyA
(
"phiHbyA",
(
fvc::flux(rho*HbyA)
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
)
fvc::flux(rho*HbyA)
);
while (pimple.correctNonOrthogonal())
@ -66,6 +59,8 @@ else
}
}
p.max(pMin);
#include "rhoEqn.H"
#include "continuityErrs.H"

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
readTimeControls
Description
Read the control parameters used by setDeltaT.
Modified for PDRFoam to include maxDeltaTRatio.
\*---------------------------------------------------------------------------*/
const bool adjustTimeStep =
runTime.controlDict().getOrDefault("adjustTimeStep", false);
scalar maxCo =
runTime.controlDict().getOrDefault<scalar>("maxCo", 1);
scalar maxDeltaT =
runTime.controlDict().getOrDefault<scalar>("maxDeltaT", GREAT);
scalar maxDeltaTRatio =
runTime.controlDict().getOrDefault<scalar>("maxDeltaTRatio", 1.2);
// ************************************************************************* //

View File

@ -1,38 +1,3 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
{
solve(betav*fvm::ddt(rho) + fvc::div(phi));
}
// ************************************************************************* //

View File

@ -36,7 +36,8 @@ Description
if (adjustTimeStep)
{
scalar maxDeltaTFact = maxCo/(CoNum + StCoNum + SMALL);
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
scalar deltaTFact =
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), maxDeltaTRatio);
runTime.setDeltaT
(

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -144,9 +145,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;

View File

@ -6,11 +6,13 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lchemistryModel
-lchemistryModel \
-lthermophysicalProperties

View File

@ -93,8 +93,8 @@ int main(int argc, char *argv[])
runTime.printExecutionTime(Info);
}
Info << "Number of steps = " << runTime.timeIndex() << endl;
Info << "End" << nl << endl;
Info<< "Number of steps = " << runTime.timeIndex() << nl;
Info<< "End\n" << endl;
return 0;
}

View File

@ -130,7 +130,7 @@ int main(int argc, char *argv[])
runTime.printExecutionTime(Info);
}
Info<< "End" << endl;
Info<< "End\n" << endl;
return 0;
}

View File

@ -1,5 +1,6 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
wclean libso BCs
wclean

View File

@ -1,7 +1,12 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
(wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam)
(
wmake $targetType BCs \
&& wmake $targetType \
&& wmake $targetType rhoCentralDyMFoam \
)
#------------------------------------------------------------------------------

View File

@ -47,4 +47,3 @@
rho.writeMinMax(Info);
}

View File

@ -1 +1,6 @@
const volScalarField& psi = thermo.psi();
bool adjustFringe
(
simple.dict().getOrDefault("oversetAdjustPhi", false)
);

View File

@ -80,7 +80,3 @@ dimensionedScalar initialMass = fvc::domainIntegrate(rho);
#include "createInterpolatedCells.H"
bool adjustFringe
(
simple.dict().getOrDefault("oversetAdjustPhi", false)
);

View File

@ -44,11 +44,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
// Forward Declarations
class magnet;
Istream& operator>>(Istream&, magnet&);
Ostream& operator<<(Ostream&, const magnet&);

View File

@ -63,4 +63,3 @@ edgeScalarField phis
),
linearEdgeInterpolate(Us) & aMesh.Le()
);

View File

@ -57,4 +57,3 @@ edgeScalarField phis
),
linearEdgeInterpolate(Us) & aMesh.Le()
);

View File

@ -1,4 +1,3 @@
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
bool compressible = (compressibility.value() > SMALL);

View File

@ -1,4 +1,3 @@
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
bool compressible = (compressibility.value() > SMALL);

View File

@ -1,4 +1,3 @@
chtMultiRegionSimpleFoam.C
EXE = $(FOAM_APPBIN)/chtMultiRegionSimpleFoam

View File

@ -14,7 +14,9 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionFaModels/lnInclude
EXE_LIBS = \
-lfiniteVolume \
@ -28,4 +30,8 @@ EXE_LIBS = \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lradiationModels \
-lregionModels
-lfvOptions \
-lfaOptions \
-lregionModels \
-lsampling \
-lregionFaModels

View File

@ -1,11 +1,11 @@
phaseSystem = $(LIB_SRC)/phaseSystemModels/reactingEuler
EXE_INC = \
-I.. \
-I$(FOAM_SOLVERS)/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialModels/lnInclude \
-I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/interfacialCompositionModels/lnInclude \
-I$(FOAM_SOLVERS)/multiphase/reactingTwoPhaseEulerFoam \
-I${phaseSystem}/twoPhaseSystem/lnInclude \
-I${phaseSystem}/twoPhaseCompressibleTurbulenceModels/lnInclude \
-I${phaseSystem}/multiphaseSystem/lnInclude \
-I./fluid \
-I../solid \
-I../fluid \
@ -23,19 +23,17 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lsolidThermo \
-ltwoPhaseReactingTurbulenceModels \
-lmeshTools \
-lfiniteVolume \
-lfvOptions \
-lradiationModels \
-lregionModels \
-lsampling \
-lreactingMultiphaseSystem \
-lreactingTwoPhaseSystem \
-lreactingPhaseSystem
-ltwoPhaseReactingTurbulenceModels

View File

@ -1,7 +1,8 @@
PtrList<uniformDimensionedScalarField> cumulativeContErrIO(fluidRegions.size());
forAll(cumulativeContErrIO, i)
{
#include "setRegionFluidFields.H"
const fvMesh& mesh = fluidRegions[i];
cumulativeContErrIO.set
(
i,

View File

@ -1,7 +1,8 @@
PtrList<uniformDimensionedScalarField> cumulativeContErrIO(fluidRegions.size());
forAll(cumulativeContErrIO, i)
{
#include "setRegionFluidFields.H"
const fvMesh& mesh = fluidRegions[i];
cumulativeContErrIO.set
(
i,

View File

@ -65,4 +65,3 @@
const dimensionedScalar rhoMin = rhoMinFluid[i];
const pressureControl& pressureControl = pressureControls[i];

View File

@ -0,0 +1,3 @@
solidFoam.C
EXE = $(FOAM_APPBIN)/solidFoam

View File

@ -0,0 +1,24 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-ldynamicMesh \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lsolidThermo \
-lradiationModels \
-lspecie

View File

@ -0,0 +1,4 @@
const volScalarField& rho = trho();
volScalarField& h = thermo.he();
const volScalarField& betav = *betavPtr;

View File

@ -0,0 +1,94 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<solidThermo> pThermo(solidThermo::New(mesh));
solidThermo& thermo = pThermo();
tmp<volScalarField> trho = thermo.rho();
autoPtr<coordinateSystem> coordinatesPtr;
autoPtr<volSymmTensorField> taniAlpha;
if (!thermo.isotropic())
{
Info<< "Adding coordinateSystem\n" << endl;
coordinatesPtr = coordinateSystem::New
(
mesh,
thermo,
coordinateSystem::typeName_()
);
tmp<volVectorField> tkappaByCp = thermo.Kappa()/thermo.Cp();
taniAlpha.reset
(
new volSymmTensorField
(
IOobject
(
"Anialpha",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedSymmTensor(tkappaByCp().dimensions(), Zero),
zeroGradientFvPatchSymmTensorField::typeName
)
);
volSymmTensorField& aniAlpha = *taniAlpha;
aniAlpha.primitiveFieldRef() =
coordinatesPtr->transformPrincipal
(
mesh.cellCentres(),
tkappaByCp()
);
aniAlpha.correctBoundaryConditions();
}
IOobject betavSolidIO
(
"betavSolid",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);
autoPtr<volScalarField> betavPtr;
if (betavSolidIO.typeHeaderOk<volScalarField>(true))
{
betavPtr.reset
(
new volScalarField
(
betavSolidIO,
mesh
)
);
}
else
{
betavPtr.reset
(
new volScalarField
(
IOobject
(
"betavSolid",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("1", dimless, scalar(1))
)
);
}
#include "createRadiationModel.H"
#include "createFvOptions.H"

View File

@ -0,0 +1,38 @@
{
fvScalarMatrix hEqn
(
fvm::ddt(betav*rho, h)
- (
thermo.isotropic()
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
)
==
fvOptions(rho, h)
);
if (mesh.changing())
{
surfaceScalarField phihMesh
(
fvc::interpolate(betav*rho*h)*mesh.phi()
);
hEqn -= fvc::div(phihMesh);
}
hEqn.relax();
fvOptions.constrain(hEqn);
hEqn.solve(); //mesh.solver(h.select(finalIter)));
fvOptions.correct(h);
thermo.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl;
radiation->correct();
}

Some files were not shown because too many files have changed in this diff Show More