Commit Graph

24321 Commits

Author SHA1 Message Date
Mark Olesen
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
sergio
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
Andrew Heather
373d88a4c4 ENH: Function1 - added some missing time conversions 2020-12-15 21:46:57 +00:00
Mark Olesen
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
Mark Olesen
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
Andrew Heather
b012475c01 ENH: snappyLayerDriver - ensure parallel consistent rebuilding of face centres 2020-12-15 20:38:41 +00:00
Andrew Heather
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
Andrew Heather
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
Kutalmis Bercin
e82956a9dc TUT: counterFlowFlame2D: add BilgerMixtureFraction FO 2020-12-15 08:55:13 +00:00
Thorsten Zirwes
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
Sergio Ferraris
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
Kutalmis Bercin
9f53fdcc36 DOC: moleFractions: improve header-file doc and style consistency
INT: moleFractions: add phaseName support
2020-12-15 08:55:13 +00:00
sergio
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
Mark Olesen
27ec25dfef STYLE: report address/field size mismatch 2020-12-14 17:30:08 +01:00
Mark Olesen
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
Andrew Heather
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
Mark Olesen
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
Mark Olesen
75f13e1890 ENH: expose fileOperation::sortTimes as public 2020-12-14 14:23:54 +01:00
Mark Olesen
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
Andrew Heather
8fa0921556 COMP: resolved some compiler warnings 2020-12-14 10:35:42 +00:00
mattijs
696704a0dd COMP: solidFoam: extraneous includes. See 1956. 2020-12-14 08:44:45 +00:00
Mark Olesen
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
Mark Olesen
b89f389606 CONFIG: support optional config.sh/readline file
- provides a hook for specifying alternative locations
2020-12-11 21:37:42 +01:00
Andrew Heather
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
Mark Olesen
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
Mark Olesen
e2d7ad5c60 GIT: rename directory PDRsetFields -> PDR 2020-12-11 20:24:24 +00:00
Andrew Heather
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
Andrew Heather
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
Andrew Heather
8534983b0a Merge remote-tracking branch 'origin/master' into develop 2020-12-11 17:42:29 +00:00
Andrew Heather
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
Vaggelis Papoutsis
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
Andrew Heather
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
Vaggelis Papoutsis
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
Andrew Heather
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
Andrew Heather
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
d0b59a4529 TUT: updated the da entries for the multi-point, turbulent optimisations 2020-12-11 17:22:44 +00:00
Vaggelis Papoutsis
73339d4985 STYLE: endl missing in the headerInfo of objectivePartialVolume 2020-12-11 17:22:44 +00:00
Vaggelis Papoutsis
6dbaeaba50 ENH: added the capability of constraining the paEqn in adjointSimple 2020-12-11 17:22:44 +00:00
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
0fb515298d ENH: adjointRASModel now returns a reference
to the primal and adjoint solver names
2020-12-11 17:21:37 +00:00
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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
Vaggelis Papoutsis
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