- resizes to current fieldNames_ size and assigns everything to
false to avoid any "stickiness" if the field ordering changes
between reads.
ENH: additional debugging faOption/fvOption (#2110)
- aids tracing which sources are being used/ignored
- update code style
STYLE: rename CodedSource -> CodedFvSource
- avoid future name clashes with CodedFaSource
- additional dummy template parameter to assist with supporting
derived classes. Currently just used for string types, but can be
extended.
- provide hash specialization for various integer types.
Removes the need for any forwarding.
- change default hasher for HashSet/HashTable from 'string::hash'
to `Hash<Key>`. This avoids questionable hashing calls and/or
avoids compiler resolution problems.
For example,
HashSet<label>::hasher and labelHashSet::hasher now both properly
map to Hash<label> whereas previously HashSet<label> would have
persistently mapped to string::hash, which was incorrect.
- standardize internal hashing functors.
Functor name is 'hasher', as per STL set/map and the OpenFOAM
HashSet/HashTable definitions.
Older code had a local templated name, which added unnecessary
clutter and the template parameter was always defaulted.
For example,
Old: `FixedList<label, 3>::Hash<>()`
New: `FixedList<label, 3>::hasher()`
Unchanged: `labelHashSet::hasher()`
Existing `Hash<>` functor namings are still supported,
but deprecated.
- define hasher and Hash specialization for bitSet and PackedList
- add symmetric hasher for 'face'.
Starts with lowest vertex value and walks in the direction
of the next lowest value. This ensures that the hash code is
independent of face orientation and face rotation.
NB:
- some of keys for multiphase handling (eg, phasePairKey)
still use yet another function naming: `hash` and `symmHash`.
This will be targeted for alignment in the future.
- overCompressibleInterDyMFoam: Overset solver for two compressible,
non-isothermal, immiscible fluids using a VOF (i.e. volume of fluid)
phase-fraction based interface capturing approach.
- overInterPhaseChangeDyMFoam: Overset solver for two incompressible,
isothermal, immiscible fluids with phase-change (e.g. cavitation) using
VoF (i.e. volume of fluid) phase-fraction based interface capturing approach.
- adds new tutorials:
- multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors
- multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors
Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
- simplifies local toggling.
- centralize fileModification static variables into IOobject.
They were previously scattered between IOobject and regIOobject
to operate with overset
1) Adding zoneMotion to rigidBodyMotion
2) Introducing PID to prescribedRotation restraint
3) Making drivenLinearMotion read total displacement
4) When drivenLinearMotion is used sixDof and rigid-body solvers
write total displacement
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.
- 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>
- 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) { ... }
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.
- 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())
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.
The phase systems tables for multiphase solvers create conflict
between each other as they are defined in the same namespace and using
similar class names.
Therefore a special htc function object for reactingEulerSolver was
added (reactingEulerHtcModel), located under
src/phaseSystemModels/reactingEulerFoam/functionObjects/
This commit includes the following:
- Relocate solvers/reactingEulerFoam functionObjects to
src/phaseSystemModels
- Remove links for fieldFunctionObject to multiphase libs to avoid
conflicts
- New FO for htc for reactingEulerFoam called reactingEulerHtcModel
- previously introduced `getOrDefault` as a dictionary _get_ method,
now complete the transition and use it everywhere instead of
`lookupOrDefault`. This avoids mixed usage of the two methods that
are identical in behaviour, makes for shorter names, and promotes
the distinction between "lookup" access (ie, return a token stream,
locate and return an entry) and "get" access (ie, the above with
conversion to concrete types such as scalar, label etc).
- Favour use of argList methods that are more similar to dictionary
method names with the aim of reducing the cognitive load.
* Silently deprecate two-parameter get() method in favour of the
more familiar getOrDefault.
* Silently deprecate opt() method in favour of get()
These may be verbosely deprecated in future versions.
multiphaseReactingTurbulenceModels and twoPhaseReactingTurbulenceModels
add models to the same table TurbulenceModel. These two libs were removed
from libreactingPhaseSystem which created the conflict.
The multiphaseReactingTurbulenceModels was added to
reactingMultiPhaseEulerFoam solver and twoPhaseReactingTurbulenceModels to
twoPhaseReactingEulerFoam solver
The FO heatTransferCoeffs for libfieldFunctionObjects needs
twoPhaseReactingTurbulenceModels.
These change avoids linking conflict from multiphaseReactingTurbulenceModels
and twoPhaseReactingTurbulenceModels being linked in the same lib.
- adds into the include-quoted search list instead the general (-Idir)
search list.
* makes it less subject to ordering (since it will now generally be
searched first) and makes it less subject to how duplicate removal
is implemented. In some compilers (#1627), the last instance of
a duplicate directory would be used and not the first instance.
* removes clutter in some Make/options files
COMP: add missing linkage libraries
1) Add interfaceHeatResistance model to icoReactingMultiphaseInterFoam
This model uses a spread source for the continuity Eq.
It is recommended for cases with good mesh resolution.
2) Adding iso-surface type of calculation for the interface for
the kineticGasEvaporation model
3) Add switch for option to take into account volume change
4) Add poolEvaporation tutorial
1) Adding interfaceHeight FO
2) Adding interfaceHeatResistance mass transfer model to
interCondensatingEvaporatingFoam with spread source approach
3) Reworking framework for icoReactingMultiphaseInterFoam
The adjoint library is enhanced with new functionality enabling
automated shape optimisation loops. A parameterisation scheme based on
volumetric B-Splines is introduced, the control points of which act as
the design variables in the optimisation loop [1, 2]. The control
points of the volumetric B-Splines boxes can be defined in either
Cartesian or cylindrical coordinates.
The entire loop (solution of the flow and adjoint equations, computation
of sensitivity derivatives, update of the design variables and mesh) is
run within adjointOptimisationFoam. A number of methods to update the
design variables are implemented, including popular Quasi-Newton methods
like BFGS and methods capable of handling constraints like loop using
the SQP or constraint projection.
The software was developed by PCOpt/NTUA and FOSS GP, with contributions from
Dr. Evangelos Papoutsis-Kiachagias,
Konstantinos Gkaragounis,
Professor Kyriakos Giannakoglou,
Andy Heather
[1] E.M. Papoutsis-Kiachagias, N. Magoulas, J. Mueller, C. Othmer,
K.C. Giannakoglou: 'Noise Reduction in Car Aerodynamics using a
Surrogate Objective Function and the Continuous Adjoint Method with
Wall Functions', Computers & Fluids, 122:223-232, 2015
[2] E. M. Papoutsis-Kiachagias, V. G. Asouti, K. C. Giannakoglou,
K. Gkagkas, S. Shimokawa, E. Itakura: ‘Multi-point aerodynamic shape
optimization of cars based on continuous adjoint’, Structural and
Multidisciplinary Optimization, 59(2):675–694, 2019
- Allows user-defined control of when the mesh motion occurs,
which can be especially useful in situations where the mesh motion
is much slower than any of the fluid physics.
For example, in constant/dynamicMeshDict:
updateControl runTime;
updateInterval 0.5;
to have mesh motion triggered every 1/2 second.
Note that the _exact_ time that the mesh motion actually occurs may
be slightly differently since the "runTime" triggering is fuzzy in
nature. It will trigger when the threshold has been crossed, which
will depend on the current time-step size.
1) Add softWall rigidBody restrain
2) Add linearSpringDamper sixDoF restrain to work as soft rope
3) dynamicMotionSolverListFvMesh changed to dictionary based input
4) Add Time reference access to sixDof restraints
5) Add drivenLinearMotion to solidBodyMotionFunctions.
A set of libraries and executables creating a workflow for performing
gradient-based optimisation loops. The main executable (adjointOptimisationFoam)
solves the flow (primal) equations, followed by the adjoint equations and,
eventually, the computation of sensitivity derivatives.
Current functionality supports the solution of the adjoint equations for
incompressible turbulent flows, including the adjoint to the Spalart-Allmaras
turbulence model and the adjoint to the nutUSpaldingWallFunction, [1], [2].
Sensitivity derivatives are computed with respect to the normal displacement of
boundary wall nodes/faces (the so-called sensitivity maps) following the
Enhanced Surface Integrals (E-SI) formulation, [3].
The software was developed by PCOpt/NTUA and FOSS GP, with contributions from
Dr. Evangelos Papoutsis-Kiachagias,
Konstantinos Gkaragounis,
Professor Kyriakos Giannakoglou,
Andy Heather
and contributions in earlier version from
Dr. Ioannis Kavvadias,
Dr. Alexandros Zymaris,
Dr. Dimitrios Papadimitriou
[1] A.S. Zymaris, D.I. Papadimitriou, K.C. Giannakoglou, and C. Othmer.
Continuous adjoint approach to the Spalart-Allmaras turbulence model for
incompressible flows. Computers & Fluids, 38(8):1528–1538, 2009.
[2] E.M. Papoutsis-Kiachagias and K.C. Giannakoglou. Continuous adjoint methods
for turbulent flows, applied to shape and topology optimization: Industrial
applications. 23(2):255–299, 2016.
[3] I.S. Kavvadias, E.M. Papoutsis-Kiachagias, and K.C. Giannakoglou. On the
proper treatment of grid sensitivities in continuous adjoint methods for shape
optimization. Journal of Computational Physics, 301:1–18, 2015.
Integration into the official OpenFOAM release by OpenCFD
Integration of VOF MULES new interfaces. Update of VOF solvers and all instances
of MULES in the code.
Integration of reactingTwoPhaseEuler and reactingMultiphaseEuler solvers and sub-models
Updating reactingEuler tutorials accordingly (most of them tested)
New eRefConst thermo used in tutorials. Some modifications at thermo specie level
affecting mostly eThermo. hThermo mostly unaffected
New chtMultiRegionTwoPhaseEulerFoam solver for quenching and tutorial.
Phases sub-models for reactingTwoPhaseEuler and reactingMultiphaseEuler were moved
to src/phaseSystemModels/reactingEulerFoam in order to be used by BC for
chtMultiRegionTwoPhaseEulerFoam.
Update of interCondensatingEvaporatingFoam solver.
Modified revert of commit 6c6f777bd5.
- The "alphaContactAngleFvPatchScalarField" occurs in several
places in the code base:
- as abstract class for two-phase properties
- in various multiphase solvers
To resolve potential linking conflicts, renamed the abstract class
as "alphaContactAngleTwoPhaseFvPatchScalarField" instead.
This permits potential linking of two-phase and multi-phase
libraries without symbol conflicts and has no effect on concrete
uses of two-phase alphaContactAngle boudary conditions.
- number of particles per parcel info to kinematic cloud
- added turbulent dispersion to basicHeterogeneousReactingParcel
- corrected dhsTrans in MUCSheterogeneousRate::calculate
- added cloud macro system to reactingParcelFoam and fixed calculation
of average particles per parcel
- added progress variable dimension to reacting model (nF)
- added ReactingHeterogeneous tutorial
ENH: Several modifycations to avoid erroneuos rays to be shot
from wrong faces.
ENH: Updating tutorials and avoiding registration of the
coarse singleCellFvMesh
Adding solarLoad tutorial case simpleCarSolarPanel
ENH: Changes needed for the merge
- Eg, with surface writers now in surfMesh, there are fewer libraries
depending on conversion and sampling.
COMP: regularize linkage ordering and avoid some implicit linkage (#1238)
- Global functions are unary or combining binary functions, which are
defined in MinMax.H (MinMaxOps.H).
There are also global reduction functions (gMinMax, gMinMaxMag)
as well as supporting 'Op' classes:
- minMaxOp, minMaxEqOp, minMaxMagOp, minMaxMagEqOp
Since the result of the functions represents a content reduction
into a single MinMax<T> value (a min/max pair), field operations
returning a field simply do not make sense.
- Implemented for lists, fields, field-fields, DimensionedField,
GeometricField (parallel reducing, with boundaries).
- Since the minMax evaluates during its operation, this makes it more
efficient for cases where both min/max values are required since it
avoids looping twice through the data.
* Changed GeometricField writeMinMax accordingly.
ENH: clip as field function
- clipping provides a more efficient, single-pass operation to apply
lower/upper limits on single or multiple values.
Examples,
scalarMinMax limiter(0, 1);
limiter.clip(value)
-> returns a const-ref to the value if within the range, or else
returns the appropriate lower/upper limit
limiter.inplaceClip(value)
-> Modifies the value if necessary to be within lower/upper limit
Function calls
clip(value, limiter)
-> returns a copy after applying lower/upper limit
clip(values, limiter)
-> returns a tmp<Field> of clipped values
- Can result in inadvertent conversions where the user should really
know or check if the pointer is valid prior to using.
- Still have several places to fix that are using the deprecated copy
construct and copy assignment
- accidentally introduced by 27c62303ad
STYLE: trial use of brace-initialized dimensionSet
- instead of writing
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0, 0), Zero);
we can use C++11 brace-initialization to bundle the parameters
for the dimensionSet construction and simply write
dimensionedScalar({1, -2, -2, 0, 0, 0}, Zero);
Note the following is incorrect syntax (extra brackets):
dimensionedScalar(({1, -2, -2, 0, 0, 0}), Zero);