- ensure that the updateControl is "non-sticky" on re-read,
even if we do not support runtime-modifiable here
STYLE: add syntax example (wingMotion), but with updateInterval 1
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
The optional 'fields' entry can be used to limit which particle fields are
written to file. If empty/not specified, all properties are written to
maintain backwards compatibility.
patchPostProcessing1
{
type patchPostProcessing;
maxStoredParcels 20;
fields (position "U.*" d T nParticle);
patches
(
cycLeft_half0
cycLeft_half1
);
}
- replace stringOps::toScalar with a more generic stringOps::evaluate
method that handles scalars, vectors etc.
- improve #eval to handle various mathematical operations.
Previously only handled scalars. Now produce vectors, tensors etc
for the entries. These tokens are streamed directly into the entry.
- use sed instead of foamDictionary and avoid log file
- ensure consistent behaviour with plot script
GIT: added missing 0/k field : inlet values still need adjustment
- Now accept '/' when reading variables without requiring
a surrounding '{}'
- fix some degenerate parsing cases when the first character is
already bad.
Eg, $"abc" would have previously parsed as a <$"> variable, even
although a double quote is not a valid variable character.
Now emits a warning and parses as a '$' token and a string token.
- an advanced feature, for example when sampling on a static patch
while some motion occurs elsewhere. [use with caution]
- If the sampled surface dictionary is modified during run-time, the
ensight file indexing for the geometry will become out of sync.
This is addressed in a subsequent commit.
Modifications to help avoid inadvertent overwriting of tutorialsTest:
- new '-force' option to overwrite existing directory
- generate a 'tutorialsTest/Alltest' script that disallows the
possibilty of self-recursion
The following three synthetic turbulence inflow boundary conditions are
examined through single-cell-domain smooth-wall plane channel flow setup:
- turbulentDFSEMInlet
- turbulentDigitalFilterInlet variant=digitalFilter
- turbulentDigitalFilterInlet variant=reducedDigitalFilter
The examinations are performed in terms of the first-/second-order turbulence
statistics provided by (Moser et al., (1999)) doi.org/10.1063/1.869966
from smooth-wall plane channel flow direct numerical simulations at Re=395.
Serial executing:
./Allrun
Parallel (decompositionMethod=scotch) executing:
./Allrunparallel
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.
- reduces some dictionary clutter and probably looks less confusing
than having an ending that may not correspond to the current OS.
Eg, "fvOptions" instead of "libfvOptions.so", "libfvOptions.dylib" ...
- convenience dlOpen method for multiple files
- 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
Adding reflecting fluxes to Solar load radiation model.
Adding functionality to the boundary radiation models and new
place holder for basic wall types such as transparent, opaqueDiffusive,
opaqueReflective,etc.
Changing radiation wall models to run time selectable.
Adding multi-band capabilities to VF model and improving the set up
for using solar loads in VF and fvDOM radiation models.
- normally findInstance will 'bottom out' with the constant directory
while doing its reverse time search. This mechanism however fails
when searching for negative start values (if there are none in the
list). Add additional logic for this so that constant will also be
used in these situations.
Note: to have decomposePar work for all times, may need the -constant option
to trigger the proper time list.
- While a rectilinear mesh can be created with blockMesh, not every mesh
created with blockMesh will satisfy the requirements for being a
rectilinear mesh.
This alternative to blockMesh uses a single block that is aligned
with the xy-z directions and specifications of the control points,
mesh divisions and expansion ratios. For example,
x
{
points ( -13.28 -0.10 6.0 19.19 );
nCells ( 10 12 10 );
ratios ( 0.2 1 5 );
}
y { ... }
z { ... }
With only one block, the boundary patch definition is simple and the
canonical face number is used directly. For example,
inlet
{
type patch;
faces ( 0 );
}
outlet
{
type patch;
faces ( 1 );
}
sides
{
type patch;
faces ( 2 3 );
}
...
- After a mesh is defined, it is trivial to retrieve mesh-related
information such as cell-volume, cell-centres for any i-j-k location
without an actual polyMesh.
STYLE: remove -noFunctionObjects from blockMesh
- no time loop, so function objects cannot be triggered anyhow.
- Extended runTimePostProcessing to include access to "live"
simulation objects such a geometry patches and sampled surfaces
stored on the "functionObjectObjects" registry.
- Add 'live' runTimePostProcessing of cloud data.
Extracts position and fields from the cloud via its objectRegistry writer
- For the "live" simulation objects, there are two new volume filters
that work directly with the OpenFOAM volume fields:
* iso-surface
* cutting planes
Both use the VTK algorithms directly and support multiple values.
Eg, can make multiple iso-levels or multiple planes parallel to each
other.
- When VTK has been compiled with MPI-support, parallel rendering will
be used.
- Additional title text properties (shadow, italic etc)
- Simplified handling of scalar-bar and visibility switches
- Support multiple text positions. Eg, for adding watermark text.
- fits better into the general sampling framework, improves flexibilty
and allows code reduction.
ENH: include surface fields on sampledSurfaces that support it
- implemented as lazy evaluation with an additional update() method.
This avoids unnecessary changes until the values are actually
required.
- apply mesh motion changes for momentum, volFieldValue,
specieReactionRates function objects
- changed the sectorCoeffs keyword to 'point' from 'axisPt'
for more similarity with other dictionaries.
Continue to accept 'axisPt' for compatibility.
- the utility had automatic triangulation removed some time ago, but
never changed its name.
- catch old uses with a surfaceMeshTriangulate deprecated script
- this corresponds to 'never match', which may be useful in combination
with -constant selection.
Eg,
surfaceMeshTriangulate -constant -time none
selects only the constant entry and suppresses any automatic time loop
STYLE: adjust help for the standard -times option
- indicate that times can be comma or space separated, since this is
otherwise not apparent. Don't mention semicolon separators in the help
since that just adds even more clutter.
- support .vtp format for geometry, surface, line, cloud.
- use native reader for handling vtk, vtp, obj, stl surface files.
For other formats, use the MeshedSurface (the surfMesh lib) to
handle reading and Foam::vtk::Tools::Patch to handle the
conversion to vtkPolyData. This combination is more memory efficient.
- update tutorial case to include vtp surface geometry
- this allows more use of the runTimePostProcessing functionObject
that will fail more gracefully if the proper version could not be
built.
The dummy functionObject simply emits a message that it is not available.
- makes the intent clearer and avoids the need for additional
constructor casting. Eg,
labelList(10, Zero) vs. labelList(10, 0)
scalarField(10, Zero) vs. scalarField(10, scalar(0))
vectorField(10, Zero) vs. vectorField(10, vector::zero)
- Now also responds to the contents of the trigger file,
processing action= contents similar to used with external coupling.
Previously it only handled an action that was defined in the
dictionary. With this update, the user can chose a diferent action
simply by echoing the appropriate action string into the trigger
file.
Reports the min|max|average AMI weights to text file and optionally
writes VTK surfaces of the sum of the weights, and mask field for
ACMI patches.
Example usage:
AMIWeights
{
type AMIWeights;
libs ("libfieldFunctionObjects.so");
writeControl writeTime;
writeFields yes;
}
Reference:
Comte-Bellot, G., and Corrsin, S., "Simple Eulerian Time Correlation of
Full- and Narrow-Band Velocity Signals in Grid-Generated, 'Isotropic'
Turbulence," Journal of Fluid Mechanics, Vol. 48, No. 2, 1971,
pp. 273–337.
- Uses the user-specified value for outputTemperature:
{
type externalCoupledTemperature;
outputTemperture fluid; // or wall;
}
Otherwises uses 'wall' as a default (for compatibility) and emits a
warning.
The T.out header now reflects the type of output. Eg,
# Values: area Tfluid qDot htc
- tutorials based on squareBend used Default_Boundary_Region explicitly
defined since they predated the defaultPatch renaming (2008).
The name 'Default_Boundary_Region' was for convenience as the default
name when converting to PROSTAR or CCM formation, but can now be
changed to something more generic.
- define wall boundary conditions for squareBend using a general regex
to allow future splitting of wall types by name.
- check if the first argument corresponds to an OpenFOAM value for
'true' (as per Switch).
True == 't', 'y', 'true', 'yes', 'on'. Everything else is not true.
- when the first argument is '-dict', it initializes the value
with a query via foamDictionary.
Eg,
isTrue -dict mydict -entry parallel
==> value=$(foamDictionary mydict -entry parallel -value)
isTrue $value
a missing entry is silently treated as false.
ENH: add getNumberOfPatchFaces function in RunFunctions
- simple extraction of nFaces from boundary file for given patch/region
- now supports a parcel selection mechanism like vtkCloud,
giving the ability to select a subset of parcels.
For example, a given stride, or removal of parcels with a small
diameter.
Eg,
dataCloud output Time: 3.2
Applying parcel filtering to 994 parcels
- add stride 4
- subtract field U : (less 0.2)
After filtering using 214/994 parcels
- add output precision control for dataCloud
- parallel output.
The output is now postProcessing/<name> for similar reasoning as
mentioned in #866 - better alignment with other function objects, no
collision with foamToVTK output.
- align the input parameters with those of vtkCloud so that we can
specify the ASCII precision and the padding width for the output
file names as well.
- emit TimeValue field, support file series generation
- support internal or boundary meshes, combining the result into a vtm
file.
- can restrict conversion based on zone names, enclosing volumes,
bounding box
- use parallel list writing, beginDataArray methods.
- use static_assert to restrict conversion of non-label integral types
- cache .vtp.series information by fileName instead of by cloud name.
This issues if the output directory changes, and simplifies code.
ENH: emit TimeValue in files generated by vtkCloud
- additional information for passing to ParaView
ENH: vtkCloud output to postProcessing/ (issue #866)
- better alignment with other function objects, no collision with
foamToVTK output.
- deprecate dimensionedType constructors using an Istream in favour of
versions accepting a keyword and a dictionary.
Dictionary entries are almost the exclusive means of read
constructing a dimensionedType. By construct from the dictionary
entry instead of doing a lookup() first, we can detect possible
input errors such as too many tokens as a result of a input syntax
error.
Constructing a dimensionedType from a dictionary entry now has
two forms.
1. dimensionedType(key, dims, dict);
This is the constructor that will normally be used.
It accepts entries with optional leading names and/or
dimensions. If the entry contains dimensions, they are
verified against the expected dimensions and an IOError is
raised if they do not correspond. On conclusion, checks the
token stream for any trailing rubbish.
2. dimensionedType(key, dict);
This constructor is used less frequently.
Similar to the previous description, except that it is initially
dimensionless. If entry contains dimensions, they are used
without further verification. The constructor also includes a
token stream check.
This constructor is useful when the dimensions are entirely
defined from the dictionary input, but also when handling
transition code where the input dimensions are not obvious from
the source.
This constructor can also be handy when obtaining values from
a dictionary without needing to worry about the input dimensions.
For example,
Info<< "rho: " << dimensionedScalar("rho", dict).value() << nl;
This will accept a large range of inputs without hassle.
ENH: consistent handling of dimensionedType for inputs (#1083)
BUG: incorrect Omega dimensions (fixes#2084)
- helps reduce clutter in the topoSetDict files.
Caveats when using this.
The older specification styles using "name" will conflict with the
set name. Eg,
{
name f0
type faceSet;
action add;
source patchToFace;
sourceInfo
{
name inlet;
}
}
would flattened to the following
{
name f0
type faceSet;
action add;
source patchToFace;
name inlet;
}
which overwrites the "name" used for the faceSet.
The solution is to use the updated syntax:
{
name f0
type faceSet;
action add;
source patchToFace;
patch inlet;
}
- old 'DELETE' enum was easily confused with 'REMOVE', which removes
the set, not the elements from the set.
- provide corresponding subtractSet() method
STYLE: HashSet set/unset instead of insert/erase methods in topoSetSource
- simplifies switching to/from bitSet storage
Update of overRhoPimpleDyMFoam and overInterDyMFoam solvers.
Adding corresponding tutorials with best possible settings
The main effort was put on reducing pressure spikes as the
stencil change with hole cells on the background mesh.
- writes positions and a single field (eg, diameter) in plain ASCII files,
suitable for importing in a spreadsheet or manipulation with
scripting tools.
- code integrated from
https://develop.openfoam.com/Community/OpenFOAM-addOns
New name: findObject(), cfindObject()
Old name: lookupObjectPtr()
Return a const pointer or nullptr on failure.
New name: findObject()
Old name: --
Return a non-const pointer or nullptr on failure.
New name: getObjectPtr()
Old name: lookupObjectRefPtr()
Return a non-const pointer or nullptr on failure.
Can be called on a const object and it will perform a
const_cast.
- use these updated names and functionality in more places
NB: The older methods names are deprecated, but continue to be defined.