Commit Graph

17013 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
e646218af9 BUG: Fixing reading of volumeUpdateMethod
Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-12-11 14:33:04 +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
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
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
b179cd355e STYLE: headers: unused includes. 2020-12-10 15:43:28 +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
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
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
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
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