From 8d0f4eb87ac4e2427928431e1437b3f766aba192 Mon Sep 17 00:00:00 2001 From: Vaggelis Papoutsis Date: Mon, 25 Nov 2024 13:09:26 +0200 Subject: [PATCH] TUT: additional topology optimisation tutorials - 1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval: showcases the initialization of the design variables using topoSet and setFields - 3DBox/losses-mass-uniformity-SQP-extraVars: showcases the use of the so-called 'extra variables' in the QP problem which relax it, allowing its solution even if there is no feasible one --- .../porosityBased/R_10x-init/0.orig/U | 70 ++++++ .../porosityBased/R_10x-init/0.orig/Ua | 72 ++++++ .../porosityBased/R_10x-init/0.orig/alpha | 62 +++++ .../porosityBased/R_10x-init/0.orig/p | 67 +++++ .../porosityBased/R_10x-init/0.orig/pa | 67 +++++ .../porosityBased/R_10x-init/Allclean | 14 ++ .../porosityBased/R_10x-init/Allrun | 23 ++ .../R_10x-init/constant/adjointRASProperties | 23 ++ .../R_10x-init/constant/transportProperties | 21 ++ .../R_10x-init/constant/turbulenceProperties | 28 +++ .../porosityBased/R_10x-init/reEval/0/U | 76 ++++++ .../porosityBased/R_10x-init/reEval/0/Ua | 78 ++++++ .../porosityBased/R_10x-init/reEval/0/p | 72 ++++++ .../porosityBased/R_10x-init/reEval/0/pa | 72 ++++++ .../porosityBased/R_10x-init/reEval/Allclean | 10 + .../R_10x-init/reEval/AllrunReEval | 18 ++ .../reEval/constant/adjointRASProperties | 23 ++ .../reEval/constant/transportProperties | 21 ++ .../reEval/constant/turbulenceProperties | 28 +++ .../R_10x-init/reEval/system/controlDict | 47 ++++ .../R_10x-init/reEval/system/decomposeParDict | 21 ++ .../R_10x-init/reEval/system/fvSchemes | 51 ++++ .../R_10x-init/reEval/system/fvSolution | 56 +++++ .../R_10x-init/reEval/system/meshDict | 38 +++ .../R_10x-init/reEval/system/optimisationDict | 91 +++++++ .../R_10x-init/system/blockMeshDict | 209 +++++++++++++++ .../R_10x-init/system/controlDict | 47 ++++ .../R_10x-init/system/decomposeParDict | 21 ++ .../porosityBased/R_10x-init/system/fvOptions | 26 ++ .../porosityBased/R_10x-init/system/fvSchemes | 51 ++++ .../R_10x-init/system/fvSolution | 56 +++++ .../R_10x-init/system/optimisationDict | 140 +++++++++++ .../R_10x-init/system/setFieldsDict | 35 +++ .../R_10x-init/system/topoSetDict | 82 ++++++ .../0.orig/U | 44 ++++ .../0.orig/Ua | 44 ++++ .../0.orig/p | 42 ++++ .../0.orig/pa | 42 ++++ .../Allclean | 15 ++ .../Allrun | 23 ++ .../constant/adjointRASProperties | 23 ++ .../constant/transportProperties | 21 ++ .../constant/turbulenceProperties | 28 +++ .../reEval/0.orig/U | 45 ++++ .../reEval/0.orig/Ua | 45 ++++ .../reEval/0.orig/p | 43 ++++ .../reEval/0.orig/pa | 43 ++++ .../reEval/Allclean | 22 ++ .../reEval/AllrunReEval | 31 +++ .../reEval/constant/adjointRASProperties | 23 ++ .../reEval/constant/dynamicMeshDict | 48 ++++ .../reEval/constant/transportProperties | 21 ++ .../reEval/constant/turbulenceProperties | 28 +++ .../reEval/system/blockMeshDict | 48 ++++ .../reEval/system/controlDict | 47 ++++ .../reEval/system/decomposeParDict | 20 ++ .../reEval/system/fvSchemes | 53 ++++ .../reEval/system/fvSolution | 54 ++++ .../reEval/system/optimisationDict | 104 ++++++++ .../reEval/system/snappyHexMeshDict | 170 +++++++++++++ .../reEval/system/surfaceFeatureExtractDict | 43 ++++ .../system/blockMeshDict | 69 +++++ .../system/controlDict | 47 ++++ .../system/createPatchDict | 91 +++++++ .../system/decomposeParDict | 25 ++ .../system/fvOptions | 22 ++ .../system/fvSchemes | 53 ++++ .../system/fvSolution | 55 ++++ .../system/optimisationDict | 237 ++++++++++++++++++ .../system/topoSetDict | 118 +++++++++ 70 files changed, 3703 insertions(+) create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/U create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/Ua create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/alpha create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/p create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/pa create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allclean create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allrun create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/adjointRASProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/transportProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/turbulenceProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/U create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/Ua create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/p create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/pa create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/Allclean create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/AllrunReEval create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/adjointRASProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/transportProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/turbulenceProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/controlDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/decomposeParDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSchemes create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSolution create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/meshDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/optimisationDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/blockMeshDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/controlDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/decomposeParDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvOptions create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSchemes create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSolution create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/optimisationDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/setFieldsDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/topoSetDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/U create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/Ua create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/p create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/pa create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allclean create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allrun create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/adjointRASProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/transportProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/turbulenceProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/U create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/Ua create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/p create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/pa create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/Allclean create mode 100755 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/AllrunReEval create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/adjointRASProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/dynamicMeshDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/transportProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/turbulenceProperties create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/blockMeshDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/controlDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/decomposeParDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSchemes create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSolution create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/optimisationDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/snappyHexMeshDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/surfaceFeatureExtractDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/blockMeshDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/controlDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/createPatchDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/decomposeParDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvOptions create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSchemes create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSolution create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/optimisationDict create mode 100644 tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/topoSetDict diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/U b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/U new file mode 100644 index 0000000000..874af88463 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/U @@ -0,0 +1,70 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0.001 0.001 0); + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type fixedValue; + value uniform (0 0 0); + } + + IEntranceWall + { + type fixedValue; + value uniform (0 0 0); + } + + OEntranceWall + { + type fixedValue; + value uniform (0 0 0); + } + + OREntranceWall + { + type fixedValue; + value uniform (0 0 0); + } + + inlet + { + type fixedValue; + value uniform (1 0 0); + } + + outlet + { + type zeroGradient; + } + + outlet-right + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/Ua b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/Ua new file mode 100644 index 0000000000..d7d34bb6f8 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/Ua @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object Ua; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + IEntranceWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + OEntranceWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + OREntranceWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + inlet + { + type adjointInletVelocity; + value uniform (0 0 0); + } + + outlet + { + type adjointOutletVelocity; + value uniform (0 0 0); + } + + outlet-right + { + type adjointOutletVelocity; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/alpha b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/alpha new file mode 100644 index 0000000000..47a9307a0b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/alpha @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + arch "LSB;label=32;scalar=64"; + class volScalarField; + location "0"; + object alpha; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + designWall + { + type zeroGradient; + } + IEntranceWall + { + type zeroGradient; + } + OEntranceWall + { + type zeroGradient; + } + OREntranceWall + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + outlet + { + type fixedValue; + value uniform 0; + } + outlet-right + { + type fixedValue; + value uniform 0; + } + frontBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/p b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/p new file mode 100644 index 0000000000..f65b4a9962 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/p @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type zeroGradient; + } + + IEntranceWall + { + type zeroGradient; + } + + OEntranceWall + { + type zeroGradient; + } + + OREntranceWall + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + outlet + { + type fixedValue; + value uniform 0.0; + } + + outlet-right + { + type fixedValue; + value uniform 0.0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/pa b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/pa new file mode 100644 index 0000000000..bc7f17f326 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/0.orig/pa @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object pa; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type zeroGradient; + } + + IEntranceWall + { + type zeroGradient; + } + + OEntranceWall + { + type zeroGradient; + } + + OREntranceWall + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + outlet + { + type adjointOutletPressure; + value uniform 0.0; + } + + outlet-right + { + type adjointOutletPressure; + value uniform 0.0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allclean b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allclean new file mode 100755 index 0000000000..0500adda7a --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allclean @@ -0,0 +1,14 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 +if [ -d "reEval" ] +then + cd reEval + ./Allclean + cd .. +fi + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allrun b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allrun new file mode 100755 index 0000000000..8339d57e08 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/Allrun @@ -0,0 +1,23 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +restore0Dir + +runApplication blockMesh +runApplication topoSet +runApplication setsToZones -noFlipMap +runApplication setFields +runApplication decomposePar +runParallel $(getApplication) + +if [[ ! -z $(which cartesian2DMesh) ]] +then + echo "Re-evaluating topO solution on a body-fitted grid" + cd reEval + ./AllrunReEval > log.AllrunReEval 2>&1 && echo "End" >> log.AllrunReEval + cd .. +fi + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/adjointRASProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/adjointRASProperties new file mode 100644 index 0000000000..907d7ff801 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/adjointRASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object adjointRASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +adjointRASModel adjointLaminar; + +adjointTurbulence on; + +printCoeffs off; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/transportProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/transportProperties new file mode 100644 index 0000000000..bf55607ced --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1e-03; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/turbulenceProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/turbulenceProperties new file mode 100644 index 0000000000..3885bb4d7b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/constant/turbulenceProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +RAS +{ + RASModel laminar; + + turbulence on; + + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/U b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/U new file mode 100644 index 0000000000..c923720500 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/U @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0.001 0.001 0); + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type fixedValue; + value uniform (0 0 0); + } + + topOPatch + { + type fixedValue; + value uniform (0 0 0); + } + + IEntranceWall + { + type fixedValue; + value uniform (0 0 0); + } + + OEntranceWall + { + type fixedValue; + value uniform (0 0 0); + } + + OREntranceWall + { + type fixedValue; + value uniform (0 0 0); + } + + inlet + { + type fixedValue; + value uniform (1 0 0); + } + + outlet + { + type zeroGradient; + } + + outlet-right + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/Ua b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/Ua new file mode 100644 index 0000000000..f500ee00c8 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/Ua @@ -0,0 +1,78 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object Ua; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + topOPatch + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + IEntranceWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + OEntranceWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + OREntranceWall + { + type adjointWallVelocity; + value uniform (0 0 0); + } + + inlet + { + type adjointInletVelocity; + value uniform (0 0 0); + } + + outlet + { + type adjointOutletVelocity; + value uniform (0 0 0); + } + + outlet-right + { + type adjointOutletVelocity; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/p b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/p new file mode 100644 index 0000000000..c62028952b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/p @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type zeroGradient; + } + + topOPatch + { + type zeroGradient; + } + + IEntranceWall + { + type zeroGradient; + } + + OEntranceWall + { + type zeroGradient; + } + + OREntranceWall + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + outlet + { + type fixedValue; + value uniform 0.0; + } + + outlet-right + { + type fixedValue; + value uniform 0.0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/pa b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/pa new file mode 100644 index 0000000000..ab9a180d58 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/0/pa @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object pa; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontBack + { + type empty; + } + + designWall + { + type zeroGradient; + } + + topOPatch + { + type zeroGradient; + } + + IEntranceWall + { + type zeroGradient; + } + + OEntranceWall + { + type zeroGradient; + } + + OREntranceWall + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + outlet + { + type adjointOutletPressure; + value uniform 0.0; + } + + outlet-right + { + type adjointOutletPressure; + value uniform 0.0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/Allclean b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/Allclean new file mode 100755 index 0000000000..4be93bec56 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase +rm -f *.stl *.fms +foamDictionary system/meshDict -entry surfaceFile -set fileName > /dev/null + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/AllrunReEval b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/AllrunReEval new file mode 100755 index 0000000000..5f644be547 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/AllrunReEval @@ -0,0 +1,18 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +time=$(foamDictionary ../system/controlDict -entry endTime -value) +cp ../optimisation/topOIsoSurfaces/topOIsoSurface$time.stl . +runApplication surfaceToFMS topOIsoSurface$time.stl +foamDictionary system/meshDict -entry surfaceFile -set topOIsoSurface$time.fms > /dev/null +sed -i 's/empty/wall/g' topOIsoSurface$time.fms +sed -i 's/inlet wall/inlet patch/g' topOIsoSurface$time.fms +sed -i 's/outlet wall/outlet patch/g' topOIsoSurface$time.fms +sed -i 's/outlet-right wall/outlet-right patch/g' topOIsoSurface$time.fms +runApplication cartesian2DMesh +runApplication decomposePar +runParallel $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/adjointRASProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/adjointRASProperties new file mode 100644 index 0000000000..907d7ff801 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/adjointRASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object adjointRASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +adjointRASModel adjointLaminar; + +adjointTurbulence on; + +printCoeffs off; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/transportProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/transportProperties new file mode 100644 index 0000000000..bf55607ced --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1e-03; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/turbulenceProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/turbulenceProperties new file mode 100644 index 0000000000..3885bb4d7b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/constant/turbulenceProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +RAS +{ + RASModel laminar; + + turbulence on; + + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/controlDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/controlDict new file mode 100644 index 0000000000..df2ed91b10 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application adjointOptimisationFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 100; + +deltaT 1; + +writeControl timeStep; + +writeInterval 3000; + +purgeWrite 1; + +writeFormat ascii; + +writePrecision 6; + +writeCompression yes; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/decomposeParDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/decomposeParDict new file mode 100644 index 0000000000..18068a3bf0 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/decomposeParDict @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSchemes b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSchemes new file mode 100644 index 0000000000..6a5f340828 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSchemes @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + gradConv cellLimited Gauss linear 1; +} + +divSchemes +{ + default Gauss linear; + div(phi,U) bounded Gauss linearUpwind gradConv; + div(-phi,Ua) bounded Gauss linearUpwind gradConv; +} + +interpolationSchemes +{ + default linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSolution b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSolution new file mode 100644 index 0000000000..4858ac70b3 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/fvSolution @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +solvers +{ + "p|pa.*|bTilda" + { + solver PCG; + preconditioner DIC; + tolerance 1e-09; + relTol 0.1; + } + + "U|Ua.*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-9; + relTol 0.1; + }; +} + +relaxationFactors +{ + fields + { + p 0.3; + "pa.*" 0.2; + } + equations + { + U 0.7; + "Ua.*" 0.5; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/meshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/meshDict new file mode 100644 index 0000000000..1706f62fa8 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/meshDict @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +FoamFile +{ + version 2; + format ascii; + class dictionary; + object meshDict; +} + +maxCellSize 0.006; + +surfaceFile fileName; + +boundaryCellSize 0.004; + +boundaryCellSizeRefinementThickness 0.015; + +boundaryLayers +{ + patchBoundaryLayers + { + "lower.*|upper.*|left.*|right.*|topOPatch" + { + nLayers 5; + thicknessRatio 1.8; + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/optimisationDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/optimisationDict new file mode 100644 index 0000000000..3030be7f97 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval/system/optimisationDict @@ -0,0 +1,91 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object optimisationDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +optimisationManager singleRun; + +primalSolvers +{ + op1 + { + active true; + type incompressible; + solver simple; + solutionControls + { + nIters 3000; + residualControl + { + "p.*" 5.e-7; + "U.*" 5.e-7; + } + } + } +} + +adjointManagers +{ + adjManager1 + { + primalSolver op1; + adjointSolvers + { + as1 + { + // choose adjoint solver + //---------------------- + active false; + type incompressible; + solver adjointSimple; + computeSensitivities false; + // manage objectives + //------------------ + objectives + { + type incompressible; + objectiveNames + { + losses + { + weight 1.; + type PtLosses; + patches (inlet "outlet.*"); + normalize true; + } + } + } + // ATC treatment + //-------------- + ATCModel + { + ATCModel standard; + } + // solution control + //------------------ + solutionControls + { + nIters 300; + residualControl + { + "pa.*" 5.e-7; + "Ua.*" 5.e-7; + } + } + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/blockMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/blockMeshDict new file mode 100644 index 0000000000..5af21380ed --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/blockMeshDict @@ -0,0 +1,209 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +vertices +( + (0 0 0) //0 + (0 0.3 0) //1 + (0 0.5 0) //2 + (0 0.55 0) //3 + (0 0.75 0) //4 + (0 1 0) //5 + (0.5 0 0) //6 + (0.5 0.3 0) //7 + (0.5 0.5 0) //8 + (0.5 0.55 0) //9 + (0.5 0.75 0) //10 + (0.5 1 0) //11 + (0.7 0 0) //12 + (0.7 0.3 0) //13 + (0.7 0.5 0) //14 + (0.7 0.55 0) //15 + (0.7 0.75 0) //16 + (0.7 1 0) //17 + (1 0 0) //18 + (1 0.3 0) //19 + (1 0.5 0) //20 + (1 0.55 0) //21 + (1 0.75 0) //22 + (1 1 0) //23 + (0 0 0.1) //24 + (0 0.3 0.1) //25 + (0 0.5 0.1) //26 + (0 0.55 0.1) //27 + (0 0.75 0.1) //28 + (0 1 0.1) //29 + (0.5 0 0.1) //30 + (0.5 0.3 0.1) //31 + (0.5 0.5 0.1) //32 + (0.5 0.55 0.1) //33 + (0.5 0.75 0.1) //34 + (0.5 1 0.1) //35 + (0.7 0 0.1) //36 + (0.7 0.3 0.1) //37 + (0.7 0.5 0.1) //38 + (0.7 0.55 0.1) //39 + (0.7 0.75 0.1) //40 + (0.7 1 0.1) //41 + (1 0 0.1) //42 + (1 0.3 0.1) //43 + (1 0.5 0.1) //44 + (1 0.55 0.1) //45 + (1 0.75 0.1) //46 + (1 1 0.1) //47 + + (-0.5 0.3 0) //48 + (-0.5 0.5 0) //49 + (-0.5 0.3 0.1) //50 + (-0.5 0.5 0.1) //51 + + (0.5 -0.5 0) //52 + (0.7 -0.5 0) //53 + (0.5 -0.5 0.1) //54 + (0.7 -0.5 0.1) //55 + + (1.5 0.55 0) //56 + (1.5 0.75 0) //57 + (1.5 0.55 0.1) //58 + (1.5 0.75 0.1) //59 +); + +blocks +( + hex (48 50 25 1 49 51 26 2 ) (1 50 20) simpleGrading (1 1 1) //0 + hex (0 24 30 6 1 25 31 7 ) (1 50 30) simpleGrading (1 1 1) //1 + hex (1 25 31 7 2 26 32 8 ) (1 50 20) simpleGrading (1 1 1) //2 + hex (2 26 32 8 3 27 33 9 ) (1 50 5) simpleGrading (1 1 1) //3 + hex (3 27 33 9 4 28 34 10) (1 50 20) simpleGrading (1 1 1) //4 + hex (4 28 34 10 5 29 35 11) (1 50 25) simpleGrading (1 1 1) //5 + hex (6 30 36 12 7 31 37 13) (1 20 30) simpleGrading (1 1 1) //6 + hex (7 31 37 13 8 32 38 14) (1 20 20) simpleGrading (1 1 1) //7 + hex (8 32 38 14 9 33 39 15) (1 20 5) simpleGrading (1 1 1) //8 + hex (9 33 39 15 10 34 40 16) (1 20 20) simpleGrading (1 1 1) //9 + hex (10 34 40 16 11 35 41 17) (1 20 25) simpleGrading (1 1 1) //10 + hex (12 36 42 18 13 37 43 19) (1 30 30) simpleGrading (1 1 1) //11 + hex (13 37 43 19 14 38 44 20) (1 30 20) simpleGrading (1 1 1) //12 + hex (14 38 44 20 15 39 45 21) (1 30 5) simpleGrading (1 1 1) //13 + hex (15 39 45 21 16 40 46 22) (1 30 20) simpleGrading (1 1 1) //14 + hex (16 40 46 22 17 41 47 23) (1 30 25) simpleGrading (1 1 1) //15 + hex (52 54 55 53 6 30 36 12) (1 20 50) simpleGrading (1 1 1) //16 + hex (21 45 58 56 22 46 59 57) (1 50 20) simpleGrading (1 1 1) //17 +); + +edges +( +); + +patches +( + wall designWall + ( + (1 0 24 25) + (3 2 26 27) + (4 3 27 28) + (5 4 28 29) + (11 5 29 35) + (17 11 35 41) + (23 17 41 47) + (22 23 47 46) + (20 21 45 44) + (19 20 44 43) + (18 19 43 42) + (0 6 30 24) + (12 18 42 36) + ) + + wall IEntranceWall + ( + (48 1 25 50) + (51 26 2 49) + ) + + wall OEntranceWall + ( + (6 52 54 30) + (12 36 55 53) + ) + + wall OREntranceWall + ( + (22 46 59 57) + (21 56 58 45) + ) + + patch inlet + ( + (49 48 50 51) + ) + patch outlet + ( + (52 53 55 54) + ) + patch outlet-right + ( + (56 57 59 58) + ) + empty frontBack + ( + (51 50 25 26) + (49 2 1 48) + + (30 54 55 36) + (6 12 53 52) + (46 45 58 59) + (22 57 56 21) + + (0 1 7 6) + (1 2 8 7) + (2 3 9 8) + (3 4 10 9) + (4 5 11 10) + (6 7 13 12) + (7 8 14 13) + (8 9 15 14) + (9 10 16 15) + (10 11 17 16) + (12 13 19 18) + (13 14 20 19) + (14 15 21 20) + (15 16 22 21) + (16 17 23 22) + + (24 30 31 25) + (25 31 32 26) + (26 32 33 27) + (27 33 34 28) + (28 34 35 29) + (30 36 37 31) + (31 37 38 32) + (32 38 39 33) + (33 39 40 34) + (34 40 41 35) + (36 42 43 37) + (37 43 44 38) + (38 44 45 39) + (39 45 46 40) + (40 46 47 41) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/controlDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/controlDict new file mode 100644 index 0000000000..a298d749e5 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application adjointOptimisationFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 50; + +deltaT 1; + +writeControl timeStep; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression yes; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/decomposeParDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/decomposeParDict new file mode 100644 index 0000000000..18068a3bf0 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/decomposeParDict @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvOptions b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvOptions new file mode 100644 index 0000000000..06a7f12f54 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvOptions @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +momSource +{ + type topOSource; + names (U Ua); + function linear; + interpolationField beta; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSchemes b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSchemes new file mode 100644 index 0000000000..6a5f340828 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSchemes @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + gradConv cellLimited Gauss linear 1; +} + +divSchemes +{ + default Gauss linear; + div(phi,U) bounded Gauss linearUpwind gradConv; + div(-phi,Ua) bounded Gauss linearUpwind gradConv; +} + +interpolationSchemes +{ + default linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSolution b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSolution new file mode 100644 index 0000000000..4858ac70b3 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/fvSolution @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +solvers +{ + "p|pa.*|bTilda" + { + solver PCG; + preconditioner DIC; + tolerance 1e-09; + relTol 0.1; + } + + "U|Ua.*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-9; + relTol 0.1; + }; +} + +relaxationFactors +{ + fields + { + p 0.3; + "pa.*" 0.2; + } + equations + { + U 0.7; + "Ua.*" 0.5; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/optimisationDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/optimisationDict new file mode 100644 index 0000000000..2b4407afca --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/optimisationDict @@ -0,0 +1,140 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object optimisationDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +optimisationManager steadyOptimisation; + +primalSolvers +{ + op1 + { + active true; + type incompressible; + solver simple; + solutionControls + { + nIters 300; + residualControl + { + "p.*" 5.e-7; + "U.*" 5.e-7; + } + } + } +} + +adjointManagers +{ + adjManager1 + { + primalSolver op1; + adjointSolvers + { + as1 + { + // choose adjoint solver + //---------------------- + active true; + type incompressible; + solver adjointSimple; + // manage objectives + //------------------ + objectives + { + type incompressible; + objectiveNames + { + losses + { + weight 1.; + type PtLosses; + patches (inlet "outlet.*"); + normalize true; + } + } + } + // ATC treatment + //-------------- + ATCModel + { + ATCModel standard; + } + // solution control + //------------------ + solutionControls + { + nIters 300; + residualControl + { + "pa.*" 5.e-7; + "Ua.*" 5.e-7; + } + } + } + vol + { + // choose adjoint solver + //---------------------- + active true; + type null; + isConstraint true; + // manage objectives + //------------------ + objectives + { + type geometric; + objectiveNames + { + vol + { + weight 1.; + type topOVolume; + percentage 0.462; + } + } + } + } + } + } +} + +optimisation +{ + designVariables + { + type topO; + sensitivityType topO; + fixedZeroPorousZones (IEntranceSet OEntranceSet OREntranceSet); + regularisation + { + regularise true; + growFromWalls true; + meanRadiusMult 10; + function tanh; + b 20; + } + betaMax 2500; + maxInitChange 0.2; + } + updateMethod + { + method ISQP; + preconditioner ShermanMorrison; + includeExtraVars true; + c 2; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/setFieldsDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/setFieldsDict new file mode 100644 index 0000000000..fe2815574a --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/setFieldsDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2206 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha 0 +); + +regions +( + boxToCell + { + box (0.0 0.0 0.0)(0.35 0.15 1.0); + + fieldValues + ( + volScalarFieldValue alpha 1 + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/topoSetDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/topoSetDict new file mode 100644 index 0000000000..e2aee06c3b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/1_Inlet_2_Outlet/porosityBased/R_10x-init/system/topoSetDict @@ -0,0 +1,82 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + // Inlet + { + name IEntranceSet; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (-1.0 0.0 0.0)(0.0 1.0 1.0); + } + } + + // Outlet + { + name OEntranceSet; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (-1.0 -1.0 0.0)(1.0 0.0 1.0); + } + } + + // Outlet-right + { + name OREntranceSet; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (1.0 0.0 0.0)(2.0 1.0 1.0); + } + } + + // Design space + { + name designSpace; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (0.0 0.0 0.0)(0.1 0.1 1.0); + } + } + + // Initialisation + /* + { + name init; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (0.0 0.0 0.0)(0.45 0.25 1.0); + } + } + */ +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/U b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/U new file mode 100644 index 0000000000..ec1ccd7e1d --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/U @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + "wall|fixedWalls" + { + type fixedValue; + value uniform (0 0 0); + } + inlet + { + type surfaceNormalFixedValue; + refValue uniform -10; + value uniform (0 0 0); + } + "outlet.*" + { + type zeroGradient; + } + symmetry + { + type symmetry; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/Ua b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/Ua new file mode 100644 index 0000000000..e8e261eee8 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/Ua @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + "wall|fixedWalls" + { + type fixedValue; + value uniform (0 0 0); + } + inlet + { + type adjointInletVelocity; + value uniform (0 0 0); + } + "outlet.*" + { + type adjointOutletVelocityFlux; + value uniform (0 0 0); + } + symmetry + { + type symmetry; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/p b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/p new file mode 100644 index 0000000000..0a914ca0f6 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/p @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + "wall|fixedWalls" + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + "outlet.*" + { + type fixedValue; + value uniform 0; + } + symmetry + { + type symmetry; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/pa b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/pa new file mode 100644 index 0000000000..caab4465f5 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/0.orig/pa @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + "wall|fixedWalls" + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + "outlet.*" + { + type adjointOutletPressure; + value uniform 0; + } + symmetry + { + type symmetry; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allclean b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allclean new file mode 100755 index 0000000000..1fc5ecb533 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allclean @@ -0,0 +1,15 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +if [ -d reEval ] +then + cd reEval + ./Allclean + cd .. +fi + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allrun b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allrun new file mode 100755 index 0000000000..6fa0be27e0 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/Allrun @@ -0,0 +1,23 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh +runApplication -s 'refinementZones' topoSet +runApplication refineHexMesh -overwrite allIO +runApplication -s 'allZones' topoSet +runApplication setsToZones -noFlipMap +runApplication createPatch -overwrite +restore0Dir +runApplication decomposePar +runParallel $(getApplication) + +if [ -d reEval ] +then + cd reEval + ./AllrunReEval > log.AllrunReEval 2>&1 && echo "End" >> log.AllrunReEval + cd .. +fi + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/adjointRASProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/adjointRASProperties new file mode 100644 index 0000000000..907d7ff801 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/adjointRASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object adjointRASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +adjointRASModel adjointLaminar; + +adjointTurbulence on; + +printCoeffs off; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/transportProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/transportProperties new file mode 100644 index 0000000000..bf55607ced --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1e-03; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/turbulenceProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/turbulenceProperties new file mode 100644 index 0000000000..3885bb4d7b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/constant/turbulenceProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +RAS +{ + RASModel laminar; + + turbulence on; + + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/U b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/U new file mode 100644 index 0000000000..7a24cbae04 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/U @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + "wall|fixedWalls|topOPatch" + { + type fixedValue; + value uniform (0 0 0); + } + inlet + { + type surfaceNormalFixedValue; + refValue uniform -10; + value uniform (0 0 0); + } + "outlet.*" + { + type zeroGradient; + } + symmetry + { + type symmetry; + } + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/Ua b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/Ua new file mode 100644 index 0000000000..95b207592e --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/Ua @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + "wall|fixedWalls|topOPatch" + { + type fixedValue; + value uniform (0 0 0); + } + inlet + { + type adjointInletVelocity; + value uniform (0 0 0); + } + "outlet.*" + { + type adjointOutletVelocityFlux; + value uniform (0 0 0); + } + symmetry + { + type symmetry; + } + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/p b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/p new file mode 100644 index 0000000000..f5c374a0e9 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/p @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + "wall|fixedWalls|topOPatch" + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + "outlet.*" + { + type fixedValue; + value uniform 0; + } + symmetry + { + type symmetry; + } + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/pa b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/pa new file mode 100644 index 0000000000..339401ae9b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/0.orig/pa @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + "wall|fixedWalls|topOPatch" + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + "outlet.*" + { + type adjointOutletPressure; + value uniform 0; + } + symmetry + { + type symmetry; + } + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/Allclean b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/Allclean new file mode 100755 index 0000000000..39b3cdb14e --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/Allclean @@ -0,0 +1,22 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +# Remove surface and features +rm -rf constant/extendedFeatureEdgeMesh +rm -rf constant/triSurface/* + +# Restore default entries in snappyHexMeshDict and surfaceFeatureExtractDict +foamDictionary system/snappyHexMeshDict -entry castellatedMeshControls.locationInMesh -remove +foamDictionary system/snappyHexMeshDict -entry castellatedMeshControls.locationInMesh -add "myLocationInMesh" + +topOEndTime=$(foamDictionary ../system/controlDict -entry 'endTime' -value) +fileName=topOIsoSurface$topOEndTime + +sed -i "s|$fileName|stlName|g" system/snappyHexMeshDict +sed -i "s|$fileName|stlName|g" system/surfaceFeatureExtractDict + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/AllrunReEval b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/AllrunReEval new file mode 100755 index 0000000000..3358572520 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/AllrunReEval @@ -0,0 +1,31 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +topOEndTime=$(foamDictionary ../system/controlDict -entry 'endTime' -value) +fileName=topOIsoSurface$topOEndTime + +# A bit ugly but expanding a stored variable of the form "(a b c)" seems tricky +locationInMesh="\(0.058 0.15 0.094\)" +sed -i "s|myLocationInMesh|$locationInMesh|g" system/snappyHexMeshDict +sed -i "s|stlName|$fileName|g" system/snappyHexMeshDict +sed -i "s|stlName|$fileName|g" system/surfaceFeatureExtractDict + +mkdir -p constant/triSurface +cp ../optimisation/topOIsoSurfaces/$fileName.stl constant/triSurface/. + +runApplication blockMesh + +runApplication surfaceFeatureExtract + +runApplication decomposePar + +runParallel snappyHexMesh -overwrite + +restore0Dir -processor + +runParallel $(getApplication) + + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/adjointRASProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/adjointRASProperties new file mode 100644 index 0000000000..907d7ff801 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/adjointRASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object adjointRASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +adjointRASModel adjointLaminar; + +adjointTurbulence on; + +printCoeffs off; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/dynamicMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/dynamicMeshDict new file mode 100644 index 0000000000..53d35a787a --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/dynamicMeshDict @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh dynamicRefineFvMesh; + +dynamicRefineFvMeshCoeffs +{ + // How often to refine + refineInterval 1; + // Field to be refinement on + field mmagfi; + // Refine field inbetween lower..upper + lowerRefineLevel -0.003; + upperRefineLevel 0; + // If value < unrefineLevel unrefine + unrefineLevel -0.003; + // Have slower than 2:1 refinement + nBufferLayers 1; + // Refine cells only up to maxRefinement levels + maxRefinement 1; + // Stop refinement if maxCells reached + maxCells 500000; + // Flux field and corresponding velocity field. Fluxes on changed + // faces get recalculated by interpolating the velocity. Use 'none' + // on surfaceScalarFields that do not need to be reinterpolated. + correctFluxes + ( + // (phi U) + // (phia Ua) + ); + // Write the refinement level as a volScalarField + dumpLevel true; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/transportProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/transportProperties new file mode 100644 index 0000000000..bf55607ced --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1e-03; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/turbulenceProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/turbulenceProperties new file mode 100644 index 0000000000..3885bb4d7b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/constant/turbulenceProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +RAS +{ + RASModel laminar; + + turbulence on; + + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/blockMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/blockMeshDict new file mode 100644 index 0000000000..40d48395d5 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/blockMeshDict @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +vertices +( + (0 0 0) //0 + (0.3 0 0) //1 + (0.3 0.3 0) //2 + (0 0.3 0) //3 + (0 0 0.3) //4 + (0.3 0 0.3) //5 + (0.3 0.3 0.3) //6 + (0 0.3 0.3) //7 +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (75 75 75) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/controlDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/controlDict new file mode 100644 index 0000000000..3a97ac4d27 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application adjointOptimisationFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 100; + +deltaT 1; + +writeControl timeStep; + +writeInterval 3000; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression false; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/decomposeParDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/decomposeParDict new file mode 100644 index 0000000000..7f6baac6cc --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/decomposeParDict @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; +method scotch; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSchemes b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSchemes new file mode 100644 index 0000000000..0673d46a7b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + gradUATC cellLimited Gauss linear 1; + grad(U) cellLimited Gauss linear 1; + gradUConv cellLimited Gauss linear 1; + gradUaConv cellLimited Gauss linear 1; +} + +divSchemes +{ + default Gauss linear; + div(phi,U) bounded Gauss linearUpwindV gradUConv; + div(-phi,Ua) bounded Gauss linearUpwindV gradUaConv; +} + +interpolationSchemes +{ + default linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +snGradSchemes +{ + default corrected; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSolution b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSolution new file mode 100644 index 0000000000..7fb387c8a6 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/fvSolution @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +solvers +{ + "p|pa.*|bTilda" + { + solver PCG; + preconditioner DIC; + tolerance 1e-09; + relTol 0.1; + } + + "U|Ua.*" smoothSolver + { + smoother GaussSeidel; + tolerance 1e-9; + relTol 0.1; + }; +} + +relaxationFactors +{ + fields + { + p 0.6; + "pa.*" 0.7; + } + equations + { + U 0.8; + "Ua.*" 0.7; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/optimisationDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/optimisationDict new file mode 100644 index 0000000000..f6786be645 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/optimisationDict @@ -0,0 +1,104 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object optimisationDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +optimisationManager singleRun; + +primalSolvers +{ + op1 + { + active true; + type incompressible; + solver simple; + solutionControls + { + nIters 3000; + residualControl + { + "p.*" 5.e-7; + "U.*" 5.e-7; + } + } + } +} + +adjointManagers +{ + adjManager1 + { + primalSolver op1; + adjointSolvers + { + as1 + { + // choose adjoint solver + //---------------------- + active false; + type incompressible; + solver adjointSimple; + computeSensitivities false; + // manage objectives + //------------------ + objectives + { + type incompressible; + objectiveNames + { + losses + { + weight 1.; + type PtLosses; + patches ("inlet.*" "outlet.*"); + } + uniformity + { + weight 1.; + type uniformityPatch; + patches (outlet1 outlet2); + } + mass + { + weight 1.; + type flowRatePartition; + inletPatches (inlet); + outletPatches (outlet1 outlet2); + targetFractions (0.5 0.5); + } + } + } + // ATC treatment + //-------------- + ATCModel + { + ATCModel standard; + } + // solution control + //------------------ + solutionControls + { + nIters 300; + residualControl + { + "pa.*" 5.e-7; + "Ua.*" 5.e-7; + } + } + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/snappyHexMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/snappyHexMeshDict new file mode 100644 index 0000000000..f66508c8e2 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/snappyHexMeshDict @@ -0,0 +1,170 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2206 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +FoamFile +{ + version 2; + format ascii; + class dictionary; + object snappyHexMeshDict; +} + +castellatedMesh true; + +snap true; + +addLayers true; + +singleRegionName true; + +geometry +{ + stlName.stl + { + type triSurfaceMesh; + name duct; + regions + { + fixedWalls + { + name fixedWalls; + } + symmetry + { + name symmetry; + } + outlet1 + { + name outlet1; + } + outlet2 + { + name outlet2; + } + inlet + { + name inlet; + } + topOPatch + { + name topOPatch; + } + } + } +} + +castellatedMeshControls +{ + maxLocalCells 100000; + maxGlobalCells 2000000; + minRefinementCells 100; + maxLoadUnbalance 0.2; + nCellsBetweenLevels 2; + features ( { file stlName.eMesh ; level 2 ; } ); + refinementSurfaces + { + duct + { + level ( 2 2 ); + patchInfo + { + type patch; + } + regions + { + "topOPatch|fixedWalls" + { + level ( 2 2 ); + patchInfo + { + type wall; + inGroups ( ductWalls ); + } + } + symmetry + { + level ( 1 1 ); + patchInfo + { + type symmetry; + } + } + } + } + } + resolveFeatureAngle 30; + refinementRegions + { + } + allowFreeStandingZoneFaces true; + locationInMesh myLocationInMesh; +} + +snapControls +{ + nSmoothPatch 3; + tolerance 2; + nSolveIter 30; + nRelaxIter 5; + nFeatureSnapIter 10; + implicitFeatureSnap false; + explicitFeatureSnap true; + multiRegionFeatureSnap false; +} + +addLayersControls +{ + relativeSizes true; + layers + { + "topOPatch|fixedWalls" + { + nSurfaceLayers 2; + } + } + expansionRatio 1; + finalLayerThickness 0.3; + minThickness 0.1; + nGrow 0; + featureAngle 60; + slipFeatureAngle 30; + nRelaxIter 3; + nSmoothSurfaceNormals 1; + nSmoothNormals 3; + nSmoothThickness 10; + maxFaceThicknessRatio 0.5; + maxThicknessToMedialRatio 0.3; + minMedialAxisAngle 90; + nBufferCellsNoExtrude 0; + nLayerIter 50; +} + +meshQualityControls +{ + maxNonOrtho 65; + maxBoundarySkewness 20; + maxInternalSkewness 4; + maxConcave 80; + minVol 1e-13; + minTetQuality 1e-15; + minArea -1; + minTwist 0.02; + minDeterminant 0.001; + minFaceWeight 0.02; + minVolRatio 0.01; + minTriangleTwist -1; + nSmoothScale 4; + errorReduction 0.75; +} + +writeFlags ( scalarLevels layerSets layerFields ); + +mergeTolerance 1e-06; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/surfaceFeatureExtractDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/surfaceFeatureExtractDict new file mode 100644 index 0000000000..d9b3f3c64c --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/reEval/system/surfaceFeatureExtractDict @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object surfaceFeatureExtractDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +stlName.stl +{ + // How to obtain raw features (extractFromFile || extractFromSurface) + extractionMethod extractFromSurface; + + // Mark edges whose adjacent surface normals are at an angle less + // than includedAngle as features + // - 0 : selects no edges + // - 180: selects all edges + includedAngle 120; + + subsetFeatures + { + // Keep nonManifold edges (edges with >2 connected faces) + nonManifoldEdges no; + + // Keep open edges (edges with 1 connected face) + openEdges yes; + } + + // Write options + + // Write features to obj format for postprocessing + writeObj yes; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/blockMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/blockMeshDict new file mode 100644 index 0000000000..a98c9165fe --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/blockMeshDict @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +vertices +( + (0 0 0) //0 + (0.2 0 0) //1 + (0.2 0.1 0) //2 + (0.2 0.2 0) //3 + (0.1 0.2 0) //4 + (0 0.1 0) //5 + (0 0 0.1) //6 + (0.2 0 0.1) //7 + (0.2 0.1 0.1) //8 + (0.2 0.2 0.1) //9 + (0.1 0.2 0.1) //10 + (0 0.1 0.1) //11 +); + +blocks +( + hex (0 1 2 5 6 7 8 11) (76 38 38) simpleGrading (1 1 1) + hex (5 2 3 4 11 8 9 10) (76 38 38) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall fixedWalls + ( + (0 1 2 5) + (7 1 2 8) + (6 0 5 11) + (0 1 7 6) + (5 2 3 4) + (8 2 3 9) + (11 5 4 10) + (4 3 9 10) + ) + symmetry symmetry + ( + (6 7 8 11) + (11 8 9 10) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/controlDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/controlDict new file mode 100644 index 0000000000..482b767380 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application adjointOptimisationFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 70; + +deltaT 1; + +writeControl timeStep; + +writeInterval 70; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression false; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/createPatchDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/createPatchDict new file mode 100644 index 0000000000..21a9f1f7df --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/createPatchDict @@ -0,0 +1,91 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object createPatchDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// This application/dictionary controls: +// - optional: create new patches from boundary faces (either given as +// a set of patches or as a faceSet) +// - always: order faces on coupled patches such that they are opposite. This +// is done for all coupled faces, not just for any patches created. +// - optional: synchronise points on coupled patches. +// - always: remove zero-sized (non-coupled) patches (that were not added) + +// 1. Create cyclic: +// - specify where the faces should come from +// - specify the type of cyclic. If a rotational specify the rotationAxis +// and centre to make matching easier +// - always create both halves in one invocation with correct 'neighbourPatch' +// setting. +// - optionally pointSync true to guarantee points to line up. + +// 2. Correct incorrect cyclic: +// This will usually fail upon loading: +// "face 0 area does not match neighbour 2 by 0.0100005%" +// " -- possible face ordering problem." +// - in polyMesh/boundary file: +// - loosen matchTolerance of all cyclics to get case to load +// - or change patch type from 'cyclic' to 'patch' +// and regenerate cyclic as above + +// Do a synchronisation of coupled points after creation of any patches. +// Note: this does not work with points that are on multiple coupled patches +// with transformations (i.e. cyclics). +pointSync false; + +// Patches to create. +patches +( + { + name inlet; + patchInfo + { + type patch; + } + constructFrom set; + set inlet; + } + + { + // Name of new patch + name outlet1; + + // Dictionary to construct new patch from + patchInfo + { + type patch; + } + + constructFrom set; + + set outlet1; + } + + { + // Name of new patch + name outlet2; + + // Dictionary to construct new patch from + patchInfo + { + type patch; + } + + constructFrom set; + + set outlet2; + } +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/decomposeParDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/decomposeParDict new file mode 100644 index 0000000000..8106d6ec75 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/decomposeParDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 60; +method hierarchical; +coeffs +{ + n (5 4 3); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvOptions b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvOptions new file mode 100644 index 0000000000..a86363cde0 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvOptions @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvOptions; +} +momSource +{ + type topOSource; + names (U Uaas1 Uauniformity Uamass); + function BorrvallPetersson; + b 100; + interpolationField beta; +} diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSchemes b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSchemes new file mode 100644 index 0000000000..9e8553999d --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + gradUATC cellLimited Gauss linear 1; + grad(U) cellLimited Gauss linear 1; + gradUConv cellLimited Gauss linear 1; + gradUaConv cellLimited Gauss linear 1; +} + +divSchemes +{ + default Gauss linear; + div(phi,U) bounded Gauss linearUpwindV gradUConv; + "div\(-phi,Ua.*\)" bounded Gauss linearUpwindV gradUaConv; +} + +interpolationSchemes +{ + default linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +snGradSchemes +{ + default corrected; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSolution b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSolution new file mode 100644 index 0000000000..42f05896c0 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/fvSolution @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +solvers +{ + "p|pa.*|bTilda" + { + solver PCG; + preconditioner DIC; + tolerance 1e-12; + relTol 0.01; + } + + "U|Ua.*" + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-12; + relTol 0.1; + }; +} + +relaxationFactors +{ + fields + { + p 0.6; + "pa.*" 0.6; + } + equations + { + U 0.8; + "Ua.*" 0.6; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/optimisationDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/optimisationDict new file mode 100644 index 0000000000..3d9eccd1bb --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/optimisationDict @@ -0,0 +1,237 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object optimisationDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +optimisationManager steadyOptimisation; + +primalSolvers +{ + op1 + { + active true; + type incompressible; + solver simple; + solutionControls + { + nIters 300; + consistent true; + residualControl + { + "p.*" 1.e-6; + "U.*" 1.e-6; + } + } + } +} + +adjointManagers +{ + adjManager1 + { + primalSolver op1; + adjointSolvers + { + as1 + { + // choose adjoint solver + //---------------------- + active true; + type incompressible; + solver adjointSimple; + isConstraint true; + // manage objectives + //------------------ + objectives + { + type incompressible; + objectiveNames + { + losses + { + weight 1.; + type PtLosses; + patches ("inlet.*" "outlet.*"); + normalize true; + target 0.778; + normFactor 0.778; + } + } + } + // ATC treatment + //-------------- + ATCModel + { + ATCModel standard; + } + // solution control + //------------------ + solutionControls + { + nIters 300; + consistent true; + residualControl + { + "pa.*" 1.e-6; + "Ua.*" 1.e-6; + } + } + } + uniformity + { + // choose adjoint solver + //---------------------- + active true; + type incompressible; + solver adjointSimple; + // manage objectives + //------------------ + objectives + { + type incompressible; + objectiveNames + { + uniformity + { + weight 1.; + type uniformityPatch; + patches (outlet1 outlet2); + normalize true; + } + } + } + // ATC treatment + //-------------- + ATCModel + { + ATCModel standard; + } + // solution control + //------------------ + solutionControls + { + nIters 300; + consistent true; + residualControl + { + "pa.*" 1.e-6; + "Ua.*" 1.e-6; + } + } + } + vol + { + // choose adjoint solver + //---------------------- + active true; + type null; + isConstraint true; + // manage objectives + //------------------ + objectives + { + type geometric; + objectiveNames + { + vol + { + weight 1.; + type topOVolume; + percentage 0.1; + } + } + } + } + mass + { + // choose adjoint solver + //---------------------- + active true; + type incompressible; + solver adjointSimple; + isConstraint true; + // manage objectives + //------------------ + objectives + { + type incompressible; + objectiveNames + { + mass + { + weight 1.; + type flowRatePartition; + inletPatches (inlet); + outletPatches (outlet1 outlet2); + targetFractions (0.5 0.5); + normalize true; + target 1.e-5; + } + } + } + // ATC treatment + //-------------- + ATCModel + { + ATCModel standard; + } + // solution control + //------------------ + solutionControls + { + nIters 300; + consistent true; + residualControl + { + "pa.*" 1.e-6; + "Ua.*" 1.e-6; + } + } + } + } + } +} + +optimisation +{ + designVariables + { + type topO; + sensitivityType topO; + regularisation + { + regularise true; + growFromWalls true; + //meanRadiusMult 10; + radius 0.0380789; + function tanh; + b 20; + } + betaMaxType Darcy; + DarcyCoeffs + { + inletPatches (inlet); + } + maxInitChange 0.2; + } + updateMethod + { + method ISQP; + preconditioner ShermanMorrison; + includeExtraVars true; +// c 2; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/topoSetDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/topoSetDict new file mode 100644 index 0000000000..7d0884c2be --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP-extraVars/system/topoSetDict @@ -0,0 +1,118 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2406 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + + { + name fixedWalls; + type faceSet; + action new; + source patchToFace; + patch fixedWalls; + } + + { + name inlet; + type faceSet; + action new; + source faceToFace; + set fixedWalls; + } + + { + name inlet; + type faceSet; + action subset; + source boxToFace; + sourceInfo + { + box (0.030 0.130 0.080) (0.070 0.170 0.120); + } + } + { + name inletZone; + type cellSet; + action new; + source faceToCell; + set inlet; + option any; + } + + { + name outlet1; + type faceSet; + action new; + source faceToFace; + set fixedWalls; + } + + { + name outlet1; + type faceSet; + action subset; + source boxToFace; + sourceInfo + { + box (0.199 0.088 0.02) (0.201 0.112 0.044); + } + } + { + name outlet1Zone; + type cellSet; + action new; + source faceToCell; + set outlet1; + option any; + } + + { + name outlet2; + type faceSet; + action new; + source faceToFace; + set fixedWalls; + } + + { + name outlet2; + type faceSet; + action subset; + source boxToFace; + sourceInfo + { + box (0.199 0.088 0.064) (0.201 0.112 0.088); + } + } + { + name outlet2Zone; + type cellSet; + action new; + source faceToCell; + set outlet2; + option any; + } + + { + name allIO; + type cellSet; + action new; + source cellToCell; + sets (inletZone outlet1Zone outlet2Zone); + } +); + +// ************************************************************************* //