openfoam merge requestshttps://develop.openfoam.com/Development/openfoam/-/merge_requests2024-03-27T13:36:51Zhttps://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 Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/675Draft: update to internal accounting for finite-area2024-03-28T14:32:47ZMark OLESENDraft: update to internal accounting for finite-areaChanges the internal storage location of finite-area from the polyMesh registry to a dedicated registry.
This allows a clearer separation of field types without name clashes (eg, can now have "U" as a name for an area velocity field). It...Changes the internal storage location of finite-area from the polyMesh registry to a dedicated registry.
This allows a clearer separation of field types without name clashes (eg, can now have "U" as a name for an area velocity field). It is also a prerequisite to supporting multiple finite-area fields in the future.
Example of old locations:
```
0/Us
constant/faMesh
system/faSolution
```
New locations:
```
0/finite-area/Us
constant/finite-area/faMesh
system/finite-area/faSolution
```
The updated locations are handled by the `foamUpgradeFiniteArea` script, which provides a simple and transparent means of managing the upgrading without adding in multiple layers of compatibility handling within the code.v2312Andrew HeatherAndrew Heatherhttps://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/673reduced overhead and non-blocking transfers for collated and masterOnly file ...2024-03-19T16:02:23ZMark OLESENreduced overhead and non-blocking transfers for collated and masterOnly file handlingThe aim of these changes is to avoid duplicate copies of character data and improved communication throughput.
The buffering in the output stream are now based on OCharStream instead of OStringStream. This allows full recovery of the st...The aim of these changes is to avoid duplicate copies of character data and improved communication throughput.
The buffering in the output stream are now based on OCharStream instead of OStringStream. This allows full recovery of the streamed characters without additional copies. The character data are _"yielded_" from the streaming buffer to pass on to the backend writers without an intermediate copy into string and copy back out of a string. The full buffer, including unused portions, is transferred to avoid triggering any alloc/free at that point. The char data can then be directly communicated (non-blocking) to the output.
On the receiving end, the size of the character content can be established directly from an MPI_Probe prior to setting up the MPI_Recv/MPI_Irecv. This avoids both the memory overhead of PstreamBuffers (the previous implementation) as well as needing to coordinate between all ranks (the PstreamBuffers has a synchronization point when establishing the buffer sizes as part of the PEX algorithm).
When using a master-only writing (non-collated), now use polling dispatch to write file content when it becomes available.v2406Mattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comhttps://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/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/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/667Draft: ENH: Polyhedral AMR2024-02-22T15:34:38ZKutalmış BerçinDraft: ENH: Polyhedral AMR@Development
Test cases: [MR666-test-cases-22Feb24.zip](/uploads/5d70f346da25f7e66088c5dbd0812eef/MR666-test-cases-22Feb24.zip)@Development
Test cases: [MR666-test-cases-22Feb24.zip](/uploads/5d70f346da25f7e66088c5dbd0812eef/MR666-test-cases-22Feb24.zip)Andrew HeatherAndrew Heatherhttps://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/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/663Misc. changes in the regionFaModels2024-02-23T15:54:11ZKutalmış BerçinMisc. changes in the regionFaModelsAndrew 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/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/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/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/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/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/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 Heather