Commit Graph

26886 Commits

Author SHA1 Message Date
Mark Olesen
852f66fc11 CONFIG: add user/group libraries into path separately (#2948)
- on Darwin _foamAddLib() also checks the library path existence
  so passing in "path1:path2" together fails.
2024-02-06 22:16:22 +01:00
Mark Olesen
08c23685c3 BUG: incorrect cumulative area in triangulatedPatch (fixes #3097)
BUG: bad processor selection. Failed to select anything on non-master
2024-02-06 11:02:26 +01:00
mattijs
d9c5a5d1a9 BUG: mapped: register to current, not other mesh. See #2723 2024-02-01 13:14:09 +00:00
Mark Olesen
ebe49d4cbd BUG: SlicedGeometricField, slices into field instead of shallow copy (#3080)
- regression introduced by e98acdc4fc

  Affected versions: (v2206, v2212, v2306, v2312)
2024-01-19 18:06:38 +01:00
Andrew Heather
62524b140c BUG: protected division - fixes #3084 2024-01-15 15:10:24 +00:00
mattijs
a46b310fa4 COMP: g++11: suppress optimisation. See #3024 2024-01-08 14:30:06 +01:00
Andrew Heather
1dc216eb1f TUT: Corrected references to mut - related to #3057 2024-01-03 09:55:44 +00:00
Andrew Heather
c4328296b0 TUT: Corrected legacy muTilda -> nuTilda. Fixes 3057 2024-01-03 09:43:23 +00:00
Vaggelis Papoutsis
52ab1fc06f TUT: changes in optimisation tutorials
- shape optimisation: SQP failed due to 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 syntax
2024-01-02 12:03:21 +00:00
Mark Olesen
58787bb166 COMP: avoid ambiguous max() call on MacOS (fixes #3066)
- had max(std::streamsize, label) but this does not resolve properly
  on OSX, so write out in long form instead.

  The similar logic in DynamicList is okay since there it compares
  max(label, label) instead
2023-12-22 15:10:49 +01:00
Mark Olesen
1d8f0d55f7 SUBMODULE: fix remnant function call in visualization 2023-12-21 16:23:42 +01:00
Andrew Heather
c39a0f6494 RELEASE: Updated version to v2312 2023-12-21 11:51:03 +00:00
Kutalmis Bercin
82417d1d8b SUBMODULE: disable turbulence-community build until compilation issues are resolved 2023-12-21 11:48:30 +00:00
Andrew Heather
f88e06cac2 Merge branch 'fix-function-objects-in-optimisation' into 'develop'
FIX: functions objects in optimisation

See merge request Development/openfoam!654
2023-12-21 09:50:33 +00:00
Vaggelis Papoutsis
e5a62a0bdd TUT: removed unnecessary computations of yPlus
in shape optimisation tutorials
2023-12-21 09:50:26 +00:00
Vaggelis Papoutsis
d5661b50de FIX: roll-back of the execution of function objects in optimisation
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.
2023-12-21 09:50:26 +00:00
Andrew Heather
9bb189d1d6 RELEASE: update API to v2312 2023-12-20 19:42:55 +01:00
Andrew Heather
28aad3a03e RELEASE: Updated headers to v2312 2023-12-20 19:42:55 +01:00
Andrew Heather
f8c20963d2 RELEASE: Updated completions cache 2023-12-20 19:42:51 +01:00
Mark Olesen
032a4519ff COMP: adjust link parameters (mingw)
- adjointOptimisation : missing link to fileFormats

- snappyHexMesh : add fvMotionSolvers link (#3058)

STYLE: remove remnant -DFULLDEBUG hints

- now more easily covered with wmake -debug ...
2023-12-20 19:22:19 +01:00
mattijs
cf47600dde ENH: snappyHexMeshDict: some comment 2023-12-20 15:00:40 +00:00
Mark Olesen
de133af526 FIX: redistributePar problems with lagrangian
- the fileHandler changes included setting cacheLevel(0) to avoid
  blocking with redistributePar. However, this meant if clouds
  were not uniformly present on all ranks the fileHandler would follow
  different code paths and lead to blocking.

  Now switch to distributed mode for the lagrangian operations within
  redistributePar based on the cacheLevel information.

FIX: avoid triggering a false processor check in argList

- when redistributing to few ranks
2023-12-20 15:18:55 +01:00
Mark Olesen
88be9ef5c6 FIX: provide default uniform scotch weighting (#3063)
- maintains the same code path within scotch
2023-12-20 13:28:17 +01:00
Andrew Heather
7d9bba67c1 BUG: Fixed keepParticle regression introduced in 8fb148bb 2023-12-20 12:25:37 +00:00
mattijs
2602d08d8a TUT: mergePairs: cleanup 2023-12-20 11:58:53 +00:00
Andrew Heather
af43f9aa24 ENH: caseInfo - use OF dictionary as default writeFormat
STYLE: checkMesh - removed writeChecks uppercase JSON option
2023-12-19 20:31:08 +00:00
Andrew Heather
686f2a3986 Merge branch 'extrae-profiling' into 'develop'
ENH: add profiling hooks for Extrae into the OpenFOAM profiling (#3043)

See merge request Development/openfoam!652
2023-12-19 14:45:43 +00:00
Josep Pocurull Serra
0fbdbb8330 ENH: add profiling hooks for Extrae into the OpenFOAM profiling (#3043)
- the hooks are defined as weak symbols and are compiled into OpenFOAM
  by default. If the library is not loaded (via LD_PRELOAD) the hooks
  have no effect.

    - https://tools.bsc.es/extrae
    - https://tools.bsc.es/paraver
2023-12-19 14:45:32 +00:00
Andrew Heather
e8f0cfb2a5 Merge branch 'feature-topology-optimization' into 'develop'
ENH: update of the adjoint library and introduction of topology optimisation

See merge request Development/openfoam!649
2023-12-18 18:01:56 +00:00
Vaggelis Papoutsis
4c3f9a9772 TUT: added topology optimisation tutorials
using the Borrvall-Petersson method to compute the source terms of the
flow equations.
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
7868d9251a TUT: added a topology optimisation tutorial using ISQP
to update the design variables
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
0af46becdd ENH: treating issues with the convergence of ISQP
The solution of the QP subproblem can become quite expensive, especially
for cases with many design variables (e.g. topology optimisation).

A (potentially dense) matrix with the size of the design variables is
solved using a matrix-free CG solver. The convergence speed greatly
depends on the used preconditioner. This commit adds
preconditioner-vector products based on the L-BFGS inverse Hessian and,
more importantly, a preconditioner computed using the Sherman-Morrison
formula. The latter is applicable here since the LHS of the QP problem
is computed as the sum of rank-2 L-BFGS updates, a sum of rank-1 updates
(as many as the flow-related constraints) and a diagonal matrix
depending on the bound constraints.

Additionally, the QP subproblem could have no feasible points. To relax
this, constraints can be applied gradually through the
targetConstraintReduction enty (typical value of 0.1 for topology
optimisation).
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
0120d7720b BUG: topology optimisation design variables were not written
properly for continuation (written through SubField instead of Field)
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
afe9b90d04 STYLE: homogenised the use of "topO" instead of "topo"
whenever refering to topology optimisation.
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
a6e9a29f41 TUT: minor updates to the topology optimisation tutorials
Replaced 'convertToMeters' with 'scale' in blockMeshDicts and added the
creation of the triSurface folder in some re-evaluation cases
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
634f921831 GIT: removed unused file incompressibleAdjointSolverTemplates.C 2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
28c538f3e1 ENH: the boundary value of the regularised field of design variables
(aTilda) in topology optimisation can now be provided through the 'wallValue' in the
regularisation dictionary (defaults to 1)
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
3cd2b2c692 ENH: The (final) sensitivities involved in topology optimisation
runs can now be written to files using the 'writeAllFields' flag in the
designVariables dictionary (defaults to false)
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
c3b212e06c ENH: Input in objectiveFlowRatePartition now reads "targetFractions"
instead of targetPercentages, with a compatibility read on the latter.
Changed corresponding tutorials too.
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
eabb821926 TUT: updated the topology optimisation tutorials
Most cases now rely on the nullSpace update method, instead of MMA,
since it has proven more reliable.

Also, added some constrained optimisation cases, including constraints
on the flow rate partition and total pressure losses as well as cases
targeting uniformity as the objective function.

Added a 3D topology optimisation case which also includes constraints.
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
46757d12ec ENH: minor update in levelSet-based topology optimisation,
to keep the regularised design variables and the signed distance in
different fields
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
1f7fb08060 BUG: wrong numbering when determining the zoneIDs
of the STL written by topology optimisation.

BUG: when determining which mesh faces are cut by iso-surface faces,
only append the latter if it contains more than two points
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
e5d5e7b0be ENH: added the option to stop the normalisation
of the objective and constraint gradients in MMA, at a specific
optimisation cycle
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
bf18fb758c ENH: nullSpace will now perturb the design variables
by a small amount, if all of them lay on the lower or upper bounds at
the beginning of the optimisation, to avoid singular matrices when
computing the update of the design variables.
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
e764f7b573 ENH: flowRate and flowRatePartition objectives are now computed
based on phi, instead of U & Sf
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
b5b48b66d1 ENH: enabled the postProcess option in adjointOptimisationFoam 2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
741520801a STYLE: minor change on the output of max mags of the adjoint fields 2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
8947735b1d ENH: enable the execution of functions objects in optimisation mode 2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
2ad6c9f5d2 ENH: adjointRASModel will not crash if set to laminar
and the Jacobian of the objective function wrt the turbulence variables
is called (rare/unorthodox case).

Additionally, objectivePowerDissipation dissipation can now be used in
topology optimisation, adding the necessary blockage dependency to it.
2023-12-18 18:01:35 +00:00
Vaggelis Papoutsis
753a534382 ENH: changes in topOVariablesBase and derived classes
- Building the iso-surface spliting fluid and solid parts in topology
  optimisation has been re-worked to obtain an iso-surface with unique
  point numbering
- The mechanism behind marchingCells for dynamicTopODesignVariables has
  been slightly reworked
2023-12-18 18:01:35 +00:00