OpenFOAM-plus merge requestshttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests2019-10-17T12:26:30Zhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/284Issue 1454 post process2019-10-17T12:26:30ZAndrew HeatherIssue 1454 post processUpdated `postProcess` for mesh changes to update the function objects instead of performing a full clear-outUpdated `postProcess` for mesh changes to update the function objects instead of performing a full clear-outv1912Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/272Feature mixed precision2019-08-13T11:07:08ZMark OLESENFeature mixed precisionThis set of changes makes it easier to identify and manage binary reading from different representations. For example, a binary file written from an OpenFOAM installation with WM_SP, WM_LABEL_SIZE=32 can be read back as WM_DP and/or WM_L...This set of changes makes it easier to identify and manage binary reading from different representations. For example, a binary file written from an OpenFOAM installation with WM_SP, WM_LABEL_SIZE=32 can be read back as WM_DP and/or WM_LABEL_SIZE=64. This is managed internally by using the "arch" information that is included in the binary output files. For example,
```
FoamFile
{
version 2.0;
format binary;
class vectorField;
arch "LSB;label=32;scalar=64";
location "constant/polyMesh";
object points;
}
```
On reading, the size information is used to determine if the label/scalar sizes in the file correspond to the *native* version of the currently active OpenFOAM installation. If the values are identical, the binary file reading is as always. If, however, there is a discrepancy between the label/scalar sizes in the file and the current OpenFOAM sizes, the values will be read in the raw format and converted on-the-fly. This adds no additional memory overhead, but can potentially result in somewhat lower reading speeds. There are some additional operations when narrowing the representation (eg, reading in double but saving as float) to avoid underflow and overflow, but it cannot work magic. If your input file has 1e10 faces, the addressing will not fit into a signed or unsigned 32-bit integer.
To manage the reading, the new trait structures `is_contiguous`, `is_contiguous_label`, `is_contiguous_scalar` are used. For data payloads that comprise homogenous base types (ie, the lowest level component is entirely scalar or label) the Detail::readContiguous is used for managing the reading in a uniform manner. For heterogeneous data types, the author of the class must address this individually. This is typically in the following form:
```
if (is.format() == IOstream::ASCII)
{
is >> start_ >> end_ >> level_ >> i_ >> j_ >> k_;
}
else if (!is.checkLabelSize<>() || !is.checkScalarSize<>())
{
// Non-native label or scalar size
is.beginRawRead();
readRawScalar(is, start_.data(), vector::nComponents);
readRawScalar(is, end_.data(), vector::nComponents);
readRawLabel(is, &level_);
readRawLabel(is, &i_);
readRawLabel(is, &j_);
readRawLabel(is, &k_);
is.endRawRead();
}
else
{
is.read
(
reinterpret_cast<char*>(&start_),
sizeofFields_
);
}
```
### Limitation
Changes in the endian type are not handled.v1912Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/269Integration adjoint2019-12-04T11:06:47ZAndrew HeatherIntegration adjoint## New adjoint optimisation and tools
A set of libraries and executables creating a workflow for performing
gradient-based optimisation loops. The main executable (adjointOptimisationFoam)
solves the flow (primal) equations, followe...## New adjoint optimisation and tools
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
Integration into the official OpenFOAM release by OpenCFDv1906Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/231Function object updates2019-01-31T17:00:02ZAndrew HeatherFunction object updatesRenamed the `residuals` function object to `solverInfo` since it now generates:
* residual fields
* solver type
* initial residual
* final residual
* number of solver iterations
* convergecnce flag
Added new `continuityError` function ...Renamed the `residuals` function object to `solverInfo` since it now generates:
* residual fields
* solver type
* initial residual
* final residual
* number of solver iterations
* convergecnce flag
Added new `continuityError` function object. Example usage:
continuityError1
{
type continuityError;
libs ("libfieldFunctionObjects.so");
...
writeToFile yes;
log yes;
phi phi;
}
\endverbatimv1906Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/228Feature run time control triggers2019-01-24T05:50:29ZAndrew HeatherFeature run time control triggersExtends the `runTimeControl` function object to set 'trigger' values, that can be used to start other function objects. For example, to run for 100 steps after the average drag coefficient converges (reported by a `forceCoeffs` function...Extends the `runTimeControl` function object to set 'trigger' values, that can be used to start other function objects. For example, to run for 100 steps after the average drag coefficient converges (reported by a `forceCoeffs` function object) the following could be used:
```
runTimeControl1
{
type runTimeControl;
libs ("libutilityFunctionObjects.so");
conditions
{
condition1
{
type average;
functionObject forceCoeffs1;
fields (Cd);
tolerance 1e-3;
window 20;
windowType exact;
}
}
satisfiedAction setTrigger;
trigger 1;
}
runTimeControl2
{
type runTimeControl;
libs ("libutilityFunctionObjects.so");
controlMode trigger;
triggerStart 1;
conditions
{
condition1
{
type maxDuration;
duration 100;
}
}
satisfiedAction end;
}
```
See the `$FOAM_TUTORIALS/incompressible/simpleFoam/simpleCar tutorial`v1906Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/223ENH: momentum field function (issue #1105)2018-12-04T14:26:43ZMark OLESENENH: momentum field function (issue #1105)Calculates linear/angular momentum, reporting integral values
and optionally writing the fields.
Example
```
momentum1
{
type momentum;
libs ("libfieldFunctionObjects.so");
...
...Calculates linear/angular momentum, reporting integral values
and optionally writing the fields.
Example
```
momentum1
{
type momentum;
libs ("libfieldFunctionObjects.so");
...
selectionMode all;
writeMomentum yes;
writeVelocity no;
cylindrical true;
origin (0 0 0);
e1 (1 0 0);
e3 (0 0 1);
}
```Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/213Feature vtm/vtk2018-11-26T10:30:41ZMark OLESENFeature vtm/vtkIncludes numerous modifications to the VTK-related infrastructure. Notably it adds parallel output for foamToVTK and for the vtkWrite function object. Multi-region, multi-block VTM output with associated time-series files. TimeValue time...Includes numerous modifications to the VTK-related infrastructure. Notably it adds parallel output for foamToVTK and for the vtkWrite function object. Multi-region, multi-block VTM output with associated time-series files. TimeValue time-stamps within all the generated files. Improvements to the vtkCloud and vtkWrite function objects to allow selection of regions of interest.v1812Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/211coordinate system improvements2018-10-11T15:32:04ZMark OLESENcoordinate system improvementsReworked coordinate systems and rotations API.Reworked coordinate systems and rotations API.v1812Mattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/210Feature processor level of detail (LOD)2018-06-25T07:55:22ZAndrew HeatherFeature processor level of detail (LOD)Adds a new method to calculate processor distribution maps as an alternative to the AABBTree; currently available to the mapFieldsPar utility via a new command line optionAdds a new method to calculate processor distribution maps as an alternative to the AABBTree; currently available to the mapFieldsPar utility via a new command line optionv1806https://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/205Feature iso advector AMR2018-06-13T13:44:39ZJohan RoenbyFeature iso advector AMR1. interIsoFoam rewritten based on the new interFoam including DyM functionality.
2. isoAdvection, isoCutFace and isoCutCell classes modified to work with AMR (dynamicRefineFvMesh).
3. Refactoring of isoAdvection, isoCutFace and isoCut...1. interIsoFoam rewritten based on the new interFoam including DyM functionality.
2. isoAdvection, isoCutFace and isoCutCell classes modified to work with AMR (dynamicRefineFvMesh).
3. Refactoring of isoAdvection, isoCutFace and isoCutCell (not related to AMR functionality).
4. Included damBreakWithObstacle test case for interIsoFoam with dynamicRefineFvMesh.
5. Added discInConstantFlowCyclicBC case for interIsoFoam to confirm proper behaviour with cyclic BC's (not AMR related).
I have tested the changes by compiling, running all interIsoFoam tutorials and verified visually that everything looks OK.
Known issue: isoCutFace sometimes gives a warning related to an edge being cut multiple times by the isoFace (There are around 20 such warnings in the damBreakWithObstacle log). It does not seem to have any effect on the results. I have not so far been able to locate the cause of these warnings.
Best regards
Johanv1806Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/201Feature regionsplit2018-04-30T10:21:46ZMark OLESENFeature regionsplitv1806Mattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/200ENH: new bitSet class and improved PackedList class (closes #751)2018-04-25T10:40:00ZMark OLESENENH: new bitSet class and improved PackedList class (closes #751)- The bitSet class replaces the old PackedBoolList class.
The redesign provides better block-wise access and reduced method
calls. This helps both in cases where the bitSet may be relatively
sparse, and in cases where advantage ...- The bitSet class replaces the old PackedBoolList class.
The redesign provides better block-wise access and reduced method
calls. This helps both in cases where the bitSet may be relatively
sparse, and in cases where advantage of contiguous operations can be
made. This makes it easier to work with a bitSet as top-level object.
In addition to the previously available count() method to determine
if a bitSet is being used, now have simpler queries:
- all() - true if all bits in the addressable range are empty
- any() - true if any bits are set at all.
- none() - true if no bits are set.
These are faster than count() and allow early termination.
The new test() method tests the value of a single bit position and
returns a bool without any ambiguity caused by the return type
(like the get() method), nor the const/non-const access (like
operator[] has). The name corresponds to what std::bitset uses.
The new find_first(), find_last(), find_next() methods provide a faster
means of searching for bits that are set.
This can be especially useful when using a bitSet to control an
conditional:
OLD (with macro):
forAll(selected, celli)
{
if (selected[celli])
{
sumVol += mesh_.cellVolumes()[celli];
}
}
NEW (with const_iterator):
for (const label celli : selected)
{
sumVol += mesh_.cellVolumes()[celli];
}
or manually
for
(
label celli = selected.find_first();
celli != -1;
celli = selected.find_next()
)
{
sumVol += mesh_.cellVolumes()[celli];
}
- When marking up contiguous parts of a bitset, an interval can be
represented more efficiently as a labelRange of start/size.
For example,
OLD:
if (isA<processorPolyPatch>(pp))
{
forAll(pp, i)
{
ignoreFaces.set(i);
}
}
NEW:
if (isA<processorPolyPatch>(pp))
{
ignoreFaces.set(pp.range());
}
v1806Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/198Feature wmake2023-12-07T19:03:31ZMark OLESENFeature wmakeIntroduce C++-based make depend parser (using ragel FSM parser) to address #784, but also to reduce some dependency on Flex (which may be out of date on some systems).Introduce C++-based make depend parser (using ragel FSM parser) to address #784, but also to reduce some dependency on Flex (which may be out of date on some systems).v1806Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/195Feature catalyst2023-12-07T19:03:28ZMark OLESENFeature catalystIntegration of ParaView Catalyst (issue #705) via a function object.Integration of ParaView Catalyst (issue #705) via a function object.v1806Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/194ENH: reduce profiling overhead (issue #764)2023-12-07T19:03:30ZMark OLESENENH: reduce profiling overhead (issue #764)- avoid clockTime in favour of clockValue.
- avoid allocations when profiling is not active.
- replace hashing with manual pointer lists- avoid clockTime in favour of clockValue.
- avoid allocations when profiling is not active.
- replace hashing with manual pointer listsv1806Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/193Updated/modified PtrList implementation2023-12-07T19:03:28ZMark OLESENUpdated/modified PtrList implementation- re-implement lowest-level with PtrListDetail to allow access to protected List methods
- new PtrDynList class: for a dynamically resizable PtrList with memory management.
- NO UPtrDynList since this is probably not needed and a plain...- re-implement lowest-level with PtrListDetail to allow access to protected List methods
- new PtrDynList class: for a dynamically resizable PtrList with memory management.
- NO UPtrDynList since this is probably not needed and a plain `DynamicList<T*>` can also be used in a pinch.v1806Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/50Feature noise2016-06-29T20:44:40ZAndrew HeatherFeature noiseNew functionality includes:
- run-time selectable noise models: point|surface
- run-time selectable window models: Hanning (+ options symmetric, extended), uniform
- calculates PSD (Pa^2/Hz) and dB/HZ; SPL (Pa^2) and dB
- calculates ...New functionality includes:
- run-time selectable noise models: point|surface
- run-time selectable window models: Hanning (+ options symmetric, extended), uniform
- calculates PSD (Pa^2/Hz) and dB/HZ; SPL (Pa^2) and dB
- calculates 1/3 octave data, with centre frequency 1kHz
surfaceNoise only:
- reads ascii/binary ensight surface data (requires collateTimes option)
- generates graphs for surface average quantities
- operates in parallelAndrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/21Feature utils2015-12-02T12:01:21ZAndrew HeatherFeature utilsUpdated utilities bases on our internal development line
Still to do:
- update ParaView module builds to build alongside standard OpenFOAM code in separate directoryUpdated utilities bases on our internal development line
Still to do:
- update ParaView module builds to build alongside standard OpenFOAM code in separate directoryMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/36ENH: added -decomposeParDict as argument to getNumberOfProcessors()2016-05-06T10:04:54ZPrashant SonakarENH: added -decomposeParDict as argument to getNumberOfProcessors()Continuing discussion at
https://develop.openfoam.com/Development/OpenFOAM-plus/commit/5c24ee4091c347a94fc4409f2d0cde864d1bfa3d?title=#note_1093
Now the Allrun script could be
```
runParallel -decomposeParDict system/decomposeParD...Continuing discussion at
https://develop.openfoam.com/Development/OpenFOAM-plus/commit/5c24ee4091c347a94fc4409f2d0cde864d1bfa3d?title=#note_1093
Now the Allrun script could be
```
runParallel -decomposeParDict system/decomposeParDict-6 snappyHexMesh -overwrite
```
Thanks @Mattijs
Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/OpenFOAM-plus/-/merge_requests/56ENH: distinguish OpenFOAM version for user-coding (fixes #195)2016-12-23T12:44:52ZMark OLESENENH: distinguish OpenFOAM version for user-coding (fixes #195)The pre-processor macro 'OPENFOAM_PLUS' is defined with a numerical
value equal to the currently compatible version number.
This can be used judiciously within user coding to help with minor
differences between OpenFOAM versions. Fo...The pre-processor macro 'OPENFOAM_PLUS' is defined with a numerical
value equal to the currently compatible version number.
This can be used judiciously within user coding to help with minor
differences between OpenFOAM versions. For example,
#ifdef OPENFOAM_PLUS
#if (OPENFOAM_PLUS >= 1612)
...
#endif
#endif
or simply
#if (OPENFOAM_PLUS >= 1612)
...
#endifAndrew HeatherAndrew Heather