openfoam merge requestshttps://develop.openfoam.com/Development/openfoam/-/merge_requests2023-12-21T09:50:34Zhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/654FIX: functions objects in optimisation2023-12-21T09:50:34ZVaggelis PapoutsisFIX: functions objects in optimisationIn steadyOptimisation mode, each time-step corresponds to an
optimisation cycle and is sub-cycled, to allow for iterating the flow
and adjoint equations. This sub-cycling does not allow the execution of
function objects. This was circumv...In steadyOptimisation mode, each time-step corresponds to an
optimisation cycle and is sub-cycled, to allow for iterating the flow
and adjoint equations. This sub-cycling does not allow the execution of
function objects. This was circumvented in 8947735b1d, by explicitly
calling the execution of the function objects in the simple solver
of adjointOptimisationFoam.
However, each sub-cycled iteration is a writeTime, if the current
optimisation cycle corresponds to a writeTime. This means that function
objects with a
writeControl write;
will be executed in each iteration of the flow equations, within this
specific optimisation cycle, leading to a lot of disc space and file
clutter, if the function object outputs fields (e.g. yPlus).
8947735b1d is partially rolled back, by protecting the call to the
execution of the function objects with a bool that defaults to false, restoring the default behavior to that prior to 8947735b1d.v2312Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/655TUT: changes in optimisation tutorials2024-01-02T11:59:41ZVaggelis PapoutsisTUT: changes in optimisation tutorials- shape optimisation: SQP failed due to a wrong divScheme for the adjoint
equations
- shape optimisation: tutorials designed to show the impact of different flow
conditions were actually using the same U
- topology optimisation: tuto...- shape optimisation: SQP failed due to a wrong divScheme for the adjoint
equations
- shape optimisation: tutorials designed to show the impact of different flow
conditions were actually using the same U
- topology optimisation: tutorials designed to show the impact of the
flow rate distribution were actually using the same target
fractions
- topology optimisation: updated old fvSolution syntaxAndrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/657BUG: ISQP crashing with the ShermanMorrison preconditiooner and no bounds (fi...2024-01-09T11:57:45ZVaggelis PapoutsisBUG: ISQP crashing with the ShermanMorrison preconditiooner and no bounds (fixes #3077)ISQP crashed during the first update of the design variables, if the
latter had no bounds and the ShermanMorrison preconditiooner was used.ISQP crashed during the first update of the design variables, if the
latter had no bounds and the ShermanMorrison preconditiooner was used.Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/658factory Clone method for handling member clone() methods2024-01-09T11:56:53ZMark OLESENfactory Clone method for handling member clone() methods- reduces code clutter, simplifies modification for new types.
Handled classes:
Function1, PatchFunction1, coordinateRotation, coordinateSystem,
particle, liquidProperties, solidProperties- reduces code clutter, simplifies modification for new types.
Handled classes:
Function1, PatchFunction1, coordinateRotation, coordinateSystem,
particle, liquidProperties, solidPropertiesAndrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/656Code adjustments to avoid gcc-13 warnings about dangling references2024-01-11T10:08:47ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comCode adjustments to avoid gcc-13 warnings about dangling referencesMark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/660Use factory Clone for patch fields2024-01-23T11:22:22ZMark OLESENUse factory Clone for patch fields- simplifies some code.- simplifies some code.Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/659ENH: mapped: keep coupling info. Fixes #30902024-01-25T13:35:03ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comENH: mapped: keep coupling info. Fixes #3090Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/662FIX: replaced temp internalField with DimensionedField::null (fixes #3082)2024-01-24T20:47:17ZVaggelis PapoutsisFIX: replaced temp internalField with DimensionedField::null (fixes #3082)`GeometricField::Boundary` allocated using createZeroBoudnaryPtr held a dangling reference to a temporary object (see also #3082).
This dangling reference was never accessed, so it didn't cause any wrong memory access. It did however i...`GeometricField::Boundary` allocated using createZeroBoudnaryPtr held a dangling reference to a temporary object (see also #3082).
This dangling reference was never accessed, so it didn't cause any wrong memory access. It did however increase the peak memory consumption.
Replaced the temporary object with `DimensionedField<Type, volMesh>::null`Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/664Remove obsolete Pstream functions2024-02-01T13:52:51ZMark OLESENRemove obsolete Pstream functionsCleanup of items that have been obsoleted and unused since around early 2022 (mostly related to broadcast functionality).
Issue #3087.Cleanup of items that have been obsoleted and unused since around early 2022 (mostly related to broadcast functionality).
Issue #3087.Mattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/666ensight cloud functionObject2024-02-02T13:31:20ZMark OLESENensight cloud functionObjectAdditional function-object to generate EnSight output for lagrangian. cross-ref EP2316Additional function-object to generate EnSight output for lagrangian. cross-ref EP2316Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/665Updates to reduce unnecessary registration of tmp fields2024-02-21T15:28:12ZMark OLESENUpdates to reduce unnecessary registration of tmp fieldsAs outlined in #2723 the registration/deregistration of tmp fields adds unnecessary hashing operations.
These changes remove most of these cases and make more extensive use of various factory methods to simplify future changes. The large...As outlined in #2723 the registration/deregistration of tmp fields adds unnecessary hashing operations.
These changes remove most of these cases and make more extensive use of various factory methods to simplify future changes. The largest contributor to tmp items is GeometricField (eg, volScalarField).
In general, the preference is to use more compact factory methods when dealing with tmp/autoPtr/refPtr.
For example,
```
auto tfld = tmp<scalarField>::New(patch.size());
auto& fld = tfld.ref();
```
instead of
```
tmp<scalarField> tfld(new scalarField(patch.size()));
auto& fld = tfld.ref();
```
When dealing with `regIOobject` types (which can be registered in an `objectRegistry`), the syntax with the `IOobject` becomes messier. Thus for tmp GeometricFields etc there is are dedicated factory methods that use the current timeName and the relevant mesh for the registry. For example,
```
auto tfld = volScalarField::New("foo", mesh, dimensionedScalar(dimless, Zero));
auto& fld = tfld.ref();
```
instead of
```
auto tfld = tmp<volScalarField>::New
(
IOobject
(
"foo",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimensionedScalar(dimless, Zero)
);
auto& fld = tfld.ref();
```
There are however instances when the tmp field **must** registered (eg, used for boundary conditions). In those cases it is also possible to explicitly specify the preferred registration handling:
```
auto tfld = volScalarField::New("foo", IOobject::REGISTER, mesh, dimensionedScalar(dimless, Zero));
auto& fld = tfld.ref();
```Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/663Misc. changes in the regionFaModels2024-02-23T15:54:11ZKutalmış BerçinMisc. changes in the regionFaModelsAndrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/661Misc. changes in the finite-area module2024-03-05T18:14:15ZKutalmış BerçinMisc. changes in the finite-area moduleAndrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/669ENH: adjust renumbering methods, extend renumberMesh options2024-03-19T14:53:03ZMark OLESENENH: adjust renumbering methods, extend renumberMesh optionsUpdate to renumber methods. The user-exposed aspect is in the `renumberMesh` application which now has additional options.
* Use -dry-run with -write-maps to visualize the before/after effects of renumbering (creates a VTK file).
* The ...Update to renumber methods. The user-exposed aspect is in the `renumberMesh` application which now has additional options.
* Use -dry-run with -write-maps to visualize the before/after effects of renumbering (creates a VTK file).
* The `-no-fields` option to renumber the mesh only. This is useful and faster when the input fields are uniform and the -overwrite option is specified.
* The `-renumber-method` allows a quick means of specifying a different default renumber method (instead of Cuthill-McKee).
* The `-renumber-coeffs` option allows passing of dictionary content for the method.
Examples,
```plaintext
// Different ways to specify reverse Cuthill-McKee
-renumber-method RCM
-renumber-coeffs 'reverse true;'
-renumber-method CuthillMcKee
-renumber-coeffs 'reverse true;'
-renumber-coeffs 'method CuthillMcKee; reverse true;'
// Other (without dictionary coefficients)
renumberMesh -renumber-method random
// Other (with dictionary coefficients)
renumberMesh \
-renumber-method spring \
-renumber-coeffs 'maxCo 0.1; maxIter 1000; freezeFraction 0.99;'
// Other (with additional libraries)
renumberMesh -renumber-method zoltan -lib zoltanRenumber
```
The new `-decompose` option permits a region-wise decomposition prior to renumbering. The effects of this can be seen in the following![renumberMesh](/uploads/db54f9de5800af743ec670568cc454e9/renumberMesh.png)
The original cells are randomly numbered. With the `-decompose` option, these can be _"lumped"_ into regions before renumbering on a per region basis. If the region-wise renumbering is forcibly _disabled_ (ie, -renumber-method none), it can be seen that the resulting cellIds retain the random nature of the original cell ordering. This corresponds to what `decomposePar` without a subsequent renumber would do, so could be indicative that an optional renumber stage would be reasonable to add into `decomposePar` in the future.v2406Kutalmış BerçinKutalmış Berçinhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/671Improve streaming matrix and internal memory management2024-03-07T10:18:28ZMark OLESENImprove streaming matrix and internal memory management- Adjust procLduMatrix etc to allow default construct and reading from stream, which enables simpler transfer of data between ranks.
- Internal memory management with unique_ptr (modernize and simplifies code).- Adjust procLduMatrix etc to allow default construct and reading from stream, which enables simpler transfer of data between ranks.
- Internal memory management with unique_ptr (modernize and simplifies code).v2406Kutalmış BerçinKutalmış Berçinhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/672misc changes for reduced stringstream and MPI overhead2024-03-07T18:11:39ZMark OLESENmisc changes for reduced stringstream and MPI overheadv2406Kutalmış BerçinKutalmış Berçinhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/670Feature overlapping zones2024-03-13T14:44:15ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comFeature overlapping zones### Summary
More functionality to allow overlapping zones (cell,face,pointZones). (note this was already supported in polyMesh and decomposePar)
### Resolved bugs (If applicable)
none
### Details of new models (If applicable)
It is ...### Summary
More functionality to allow overlapping zones (cell,face,pointZones). (note this was already supported in polyMesh and decomposePar)
### Resolved bugs (If applicable)
none
### Details of new models (If applicable)
It is not used by default - it requires explicit code changes to insert overlapping cellZones. So far adaptations have been made:
- mesh.cellZones() / faceZones() etc : investigate which zones items are in
- redistributePar
- subsetMesh
- polyTopoChange
### Risks
Should be backwards compatible.Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/668Feature topo set2024-03-18T16:13:53ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comFeature topo set- add documentation to topoSetSource
- add to etc/annotated/caseDict/topoSetSourcesDict
- add testcase
- work out what a good solidBodyMotionFunction is- add documentation to topoSetSource
- add to etc/annotated/caseDict/topoSetSourcesDict
- add testcase
- work out what a good solidBodyMotionFunction isMark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/674topoSet: allow use of 'zone' instead 'set', 'zones' instead of 'sets' in all ...2024-03-27T10:25:42ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comtopoSet: allow use of 'zone' instead 'set', 'zones' instead of 'sets' in all set sources### Summary
Everywhere a topoSetSource uses a (file-based) set allow use of a (mesh-based) zone.
### Resolved bugs (If applicable)
### Details of new models (If applicable)
If the keyword 'zone' is found instead of 'set' it instead u...### Summary
Everywhere a topoSetSource uses a (file-based) set allow use of a (mesh-based) zone.
### Resolved bugs (If applicable)
### Details of new models (If applicable)
If the keyword 'zone' is found instead of 'set' it instead uses the name to lookup the corresponding zone from the mesh. The advantage of a mesh-based zone is that they get updated if the mesh is updated.
### Risks
Change to user input: everywhere in a topoSetDict can use 'zone' or 'zones' instead of 'set' or 'sets'.Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/676Function1: added 'lookup' Function12024-03-27T13:36:51ZMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comFunction1: added 'lookup' Function1### Summary
'lookup' Function1, PatchFunction1
### Details of new models (If applicable)
```
type uniformFixedValue;
uniformValue lookup;
name myVelocity;
```### Summary
'lookup' Function1, PatchFunction1
### Details of new models (If applicable)
```
type uniformFixedValue;
uniformValue lookup;
name myVelocity;
```Andrew HeatherAndrew Heather