openfoam merge requestshttps://develop.openfoam.com/Development/openfoam/-/merge_requests2022-11-29T14:16:52Zhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/564Draft: ENH: chtMultiRegionFoam - add frozenFlow option2022-11-29T14:16:52ZKutalmış BerçinDraft: ENH: chtMultiRegionFoam - add frozenFlow optionAdds `frozenFlowOption` into `chtMultiRegion*` solvers.
#### Meta-data
* EP1924
* Test case: [multiRegionHeater.zip](/uploads/a7273dfb758f76e5ef9f99a76f299939/multiRegionHeater.zip)
* [x] `linux64ClangDPInt32Opt` (clang11)
* [x] `linux...Adds `frozenFlowOption` into `chtMultiRegion*` solvers.
#### Meta-data
* EP1924
* Test case: [multiRegionHeater.zip](/uploads/a7273dfb758f76e5ef9f99a76f299939/multiRegionHeater.zip)
* [x] `linux64ClangDPInt32Opt` (clang11)
* [x] `linux64GccDPInt32Opt`
* [x] `linux64GccSPDPInt64Debug`
* [x] Alltest: No new error/No change in existing outputv2212Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/472Draft: ENH: relative velocity usage for porosity in MRF regions2021-12-15T10:52:37ZAndrew HeatherDraft: ENH: relative velocity usage for porosity in MRF regionsRelated to #1652 - updates porosity calculation when used with MRF to use relative velocity
Test case from bug report: [rotatingCylinders-test.tgz](/uploads/49641463ba3d523874517a126aa32293/rotatingCylinders-test.tgz)Related to #1652 - updates porosity calculation when used with MRF to use relative velocity
Test case from bug report: [rotatingCylinders-test.tgz](/uploads/49641463ba3d523874517a126aa32293/rotatingCylinders-test.tgz)v2212Sergio FerrarisSergio Ferrarishttps://develop.openfoam.com/Development/openfoam/-/merge_requests/525Draft: Extend splitMeshRegions to automatically create AMI inter-region patches2022-02-17T12:01:17ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comDraft: Extend splitMeshRegions to automatically create AMI inter-region patches### Summary
splitMeshRegions by default creates one-to-one mapped patches between regions. This adds the option to generate AMI type mapped patches instead.
### Resolved bugs (If applicable)
#2251
### Details of new models (If appl...### Summary
splitMeshRegions by default creates one-to-one mapped patches between regions. This adds the option to generate AMI type mapped patches instead.
### Resolved bugs (If applicable)
#2251
### Details of new models (If applicable)
The new functionality is through the `autoPatch` command line option:
```
splitMeshRegions -autoPatch '(myInterfaces*)'
```
This will detect disconnected regions of the mesh and will attempt matching the 'myInterfaces*' patches using an AMI method. Any successful match will result in the matching faces to be put into a mapped type patch with `nearestPatchFaceAMI` as the inter-region mapping method.
### Risks
The logic is a bit more complex. There are unknowns about the behaviour of AMI type matching (it currently has no distance limit) but a different AMI matching method can be used using the `-AMIMethod` option.Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/390draft: Feature streams2021-04-29T08:25:16ZMark OLESENdraft: Feature streamsAndrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/415Draft: Integration of PDRfitMesh2021-11-10T14:26:44ZMark OLESENDraft: Integration of PDRfitMeshhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/556Draft: unsteady adjoint functionality2022-11-28T09:34:25ZVaggelis PapoutsisDraft: unsteady adjoint functionality### Summary
Introduced unsteady adjoint functionality. Currently supports full storage of the primal time-series or utilization of binomial checkpointing.
This branch also serves as a fetching point for the profiling and improvement o...### Summary
Introduced unsteady adjoint functionality. Currently supports full storage of the primal time-series or utilization of binomial checkpointing.
This branch also serves as a fetching point for the profiling and improvement of the unsteady adjoint code during the exaFoam project.
### Details of new models
- The unsteady adjoint equations are integrated backwards in time. Since each adjoint time-step requires the primal solution of that time-step to be known, schemes for managing the storage/retrieval of the entire flow series are necessary. These are implemented through the primalStorage class and its derived ones. The latter manipulate a new class of fields, called compressedGeometricFields, which provide hooks for compressing/decompressing a field during the time integration of the primal/adjoint equations. The method used for compressing/decompressing is run-time selectable.
- The current commit provides the shortGeometricField implementation which avoids the storage of patchFields that can be retrieved from the internalField (e.g. coupled, zeroGradient, symmetry, etc), to cut on the storage requirements. More elaborate compression approaches will be included in the future, during the exaFoam project.
- Two primalStorage options are included: compressedFullStorage and binomialCheckPointing.
- compressedFullStorage stores the entire flow time-series, potentially by compressing each time-step (only the above-mentioned short approach is available for the moment).
- binomialCheckPointing is based on the homonymous algorithm proposed in
\verbatim
Wang, Q., Moin, P., & Iaccarino, G..
Minimal Repetition Dynamic Checkpointing Algorithm for
Unsteady Adjoint Calculation (2009).
SIAM Journal on Scientific Computing, 31(4), 2549-2567.
10.1137/080727890,
\endverbatim
which stores the solution of the flow equations in a predefined
number of time-steps, named checkpoints. During the
backwards-in-time integration of the adjoint equations, if the
primal solution at a certain time-step is not available, it is
retrieved by re-computing the primal flow field starting from the
closest checkpoint. Checkpoints are optimally distributed
throughout the time-series to invoke the least number of flow
recomputations during the backwards-in-time solution of the
adjoint equations. Binomial checkpointing is the current state of
the art though its re-computation cost frequently amounts for an
extra solution of the flow equations in medium-to-large cases.
- The adjoint to the PISO and PIMPLE solvers, along with their solverControl variants, are additionally included.
- Objective functions are integrated in time, through appropriate entries in the dictionaries defining them.
Authored by Andreas Margetis and reviewed by Vaggelis Papoutsis, with earlier contributions from Dr. Ioannis Kavvadias.v2306Vaggelis PapoutsisVaggelis Papoutsishttps://develop.openfoam.com/Development/openfoam/-/merge_requests/576ENH: Added new parallelFvGeometryScheme2022-12-02T15:12:56ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comENH: Added new parallelFvGeometryScheme# OpenFOAM parallel-consistent geometry calculation
This release adds a new `parallel` geometry calculation method. It is used as a wrapper around other geometry calculation methods:
```
geometry
{
type parallel;
// Op...# OpenFOAM parallel-consistent geometry calculation
This release adds a new `parallel` geometry calculation method. It is used as a wrapper around other geometry calculation methods:
```
geometry
{
type parallel;
// Optional underlying geometry calculation. Default is 'basic'.
geometry
{
type highAspectRatio;
}
}
```
It
- applies owner side face geometry (centre, normal (negated)) to the other side
- recalculates cell-based geometry of affected cells
It is mainly interesting in single-precision in that it removes the
different truncation error from circulating in different direction. This
can cause problems when calculating global transformations e.g.
```
--> FOAM FATAL ERROR: (openfoam-2206)
bad size -653174757
From void Foam::List<T>::doResize(Foam::label) [with T = Foam::vectorTensorTransform; Foam::label = int]
in file lnInclude/List.C at line 84.
#0 Foam::error::printStack(Foam::Ostream&)
#1 Foam::error::simpleExit(int, bool) at ??:?
#2 Foam::error::exiting(int, bool)
#3 Foam::List<Foam::vectorTensorTransform>::doResize(int)
#4 Foam::globalIndexAndTransform::determineTransformPermutations() at ??:?
```
Note that it does not change the point positions so any other calculated geometry (e.g. cell-closedness) might be affected.
Tutorial:
Source code:
- src/finiteVolume/fvMesh/fvGeometryScheme/parallelAndrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/571ENH: Evapotranspiration utilities2022-12-01T15:16:00ZKutalmış BerçinENH: Evapotranspiration utilitiesEP1950EP1950v2212Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/577ENH: fvOptions: add writeFile functionality2022-12-02T09:46:49ZKutalmış BerçinENH: fvOptions: add writeFile functionalityEP2028
EP1947
* [x] `linux64ClangDPInt32Opt` (clang13)
* [x] `linux64GccDPInt32Opt`
* [x] `linux64GccSPDPInt64Debug`
* [x] Alltest: No new errorEP2028
EP1947
* [x] `linux64ClangDPInt32Opt` (clang13)
* [x] `linux64GccDPInt32Opt`
* [x] `linux64GccSPDPInt64Debug`
* [x] Alltest: No new errorv2212Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/578ENH: new objective functions for adjoint-based optimisation2022-12-02T09:52:21ZVaggelis PapoutsisENH: new objective functions for adjoint-based optimisation### Summary
Added five new objective functions for use in adjoint-based optimisation.
### Details of new models
The new objective functions mainly target internal flow optimisation problems. A short description and an indicative exam...### Summary
Added five new objective functions for use in adjoint-based optimisation.
### Details of new models
The new objective functions mainly target internal flow optimisation problems. A short description and an indicative example for each of them follows. All figures that follow depict the velocity magnitude.
**flowRate**
Computes and minimizes/maximizes the volume-flow rate through a given set of patches. An indicative application follows, in which the flow-rate though the upper part of the duct should be maximized (flow from left to right).
| _Initial geometry (52.8% of the flow-rate goes through the upper part)_ | _Optimised geometry (53.7% of the flow-rate goes through the upper part)_ |
| ------ | ------ |
| ![flowRate.0000](/uploads/765e7369a8ced43451e8ab29656a4c7e/flowRate.0000.png) | ![flowRate.0004](/uploads/e9aa8c5f8aec559742e622ca04e4bbc6/flowRate.0004.png) |
Tutorial: $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/shapeOptimisation/fork-uneven/flowRate
Source code: $FOAM_SRC/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveFlowRate
**flowRatePartition**
Used to distribute the inlet flow-rate to outlet patches with prescribed target percentages. An indicative application follows, in which the equal distribution of the inlet flow-rate to the two outlets is targeted.
| _Initial geometry (52.8%/47.2% distribution between the upper/lower outlets)_ | _Optimised geometry (equally distributed flow)_ |
| ------ | ------ |
| ![flowRate.0000](/uploads/765e7369a8ced43451e8ab29656a4c7e/flowRate.0000.png) | ![flowRatePartition.0009](/uploads/d631dc909a26f2bf22ff96ac06f59145/flowRatePartition.0009.png) |
Tutorial: $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/shapeOptimisation/fork-uneven/flowRatePartition
Source code: $FOAM_SRC/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveFlowRatePartition
**uniformityPatch**
Enhances the flow uniformity by minimizing the velocity variance computed on prescribed (outlet) patches (the lower outlet patch in this case).
| _Initial geometry_ | _Optimised geometry (velocity variance reduced by 34%)_ |
| ------ | ------ |
| ![flowRate.0000](/uploads/765e7369a8ced43451e8ab29656a4c7e/flowRate.0000.png) | ![uniformityPatchGeom.0004](/uploads/05507242bca1a0ea8b40d0aaa6f8dc7d/uniformityPatchGeom.0004.png)|
Tutorial: $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/shapeOptimisation/fork-uneven/uniformityPatch
Source code: $FOAM_SRC/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveUniformityPatch
**uniformityCellZone**
Enhances the flow uniformity by minimizing the velocity variance within prescribed cellZones.
In this case, the boundaries of the target cellZone are highlighted in black.
| _Initial geometry_ | _Optimised geometry (velocity variance reduced by 34%)_ |
| ------ | ------ |
| ![uniformityCellZone.0001](/uploads/a8bc0863c192f7e57ced2cc26a658885/uniformityCellZone.0001.png) |![uniformityCellZone.0010](/uploads/d3e6f8ee6bb6114e1dbaa381a6eef70f/uniformityCellZone.0010.png) |
Tutorial: $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/shapeOptimisation/sbend/laminar/opt/unconstrained/uniformityCellZone
Source code: $FOAM_SRC/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectiveUniformityCellZone
**powerDissipation**
Computes and minimizes the fluid power dissipation that takes place within given cellZones. If the cellZone covers the entire flow domain, this objective is equivalent to volume flow-rate weighted total pressure losses (i.e. the `PtLosses` objective function).
The boundaries of the target cellZone are highlighted in black.
| _Initial geometry_ | _Optimised geometry (Power dissipation reduced by 57% within the cellZone)_ |
| ------ | ------ |
| ![powerDissipation-partial.0001](/uploads/7e1d9b473bd08e06a7131a953bc9c1fc/powerDissipation-partial.0001.png) | ![powerDissipation-partial.0009](/uploads/ede4871e1ae40c46bf0509e15fe0b47e/powerDissipation-partial.0009.png) |
Tutorial: $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/shapeOptimisation/sbend/turbulent/SA/opt/powerDissipation
Source code: $FOAM_SRC/optimisation/adjointOptimisation/adjoint/objectives/incompressible/objectivePowerDissipationv2212Andrew HeatherAndrew Heather