diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/U b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/U new file mode 100644 index 0000000000..8c27222f5b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/U @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/0.orig/Ua b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/Ua new file mode 100644 index 0000000000..9e09bdf828 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/Ua @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/0.orig/p b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/p new file mode 100644 index 0000000000..9d0c7cb92b --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/p @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/0.orig/pa b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/pa new file mode 100644 index 0000000000..734ba35411 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/0.orig/pa @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/Allclean b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/Allclean new file mode 100755 index 0000000000..1fc5ecb533 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/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/Allrun b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/Allrun new file mode 100755 index 0000000000..6fa0be27e0 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/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/constant/adjointRASProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/constant/adjointRASProperties new file mode 100644 index 0000000000..161ad9f638 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/constant/adjointRASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/constant/transportProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/constant/transportProperties new file mode 100644 index 0000000000..566ce53a02 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/constant/turbulenceProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/constant/turbulenceProperties new file mode 100644 index 0000000000..935f07f3c7 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/constant/turbulenceProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/0.orig/U b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/U new file mode 100644 index 0000000000..37a3566963 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/U @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/0.orig/Ua b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/Ua new file mode 100644 index 0000000000..76a421646c --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/Ua @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/0.orig/p b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/p new file mode 100644 index 0000000000..3e6a4da41c --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/p @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/0.orig/pa b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/pa new file mode 100644 index 0000000000..1c318451ea --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/0.orig/pa @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/Allclean b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/Allclean new file mode 100755 index 0000000000..39b3cdb14e --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/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/reEval/AllrunReEval b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/AllrunReEval new file mode 100755 index 0000000000..3358572520 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/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/reEval/constant/adjointRASProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/adjointRASProperties new file mode 100644 index 0000000000..161ad9f638 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/adjointRASProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/constant/dynamicMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/dynamicMeshDict new file mode 100644 index 0000000000..a9ab777d92 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/dynamicMeshDict @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/constant/transportProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/transportProperties new file mode 100644 index 0000000000..566ce53a02 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/constant/turbulenceProperties b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/turbulenceProperties new file mode 100644 index 0000000000..935f07f3c7 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/constant/turbulenceProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/system/blockMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/blockMeshDict new file mode 100644 index 0000000000..88756ac5e1 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/blockMeshDict @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/system/controlDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/controlDict new file mode 100644 index 0000000000..18b6d8f4bc --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/system/decomposeParDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/decomposeParDict new file mode 100644 index 0000000000..a3754e7ed7 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/decomposeParDict @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/system/fvSchemes b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/fvSchemes new file mode 100644 index 0000000000..732d61ffe7 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/fvSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/system/fvSolution b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/fvSolution new file mode 100644 index 0000000000..ebaac32819 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/fvSolution @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/system/optimisationDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/optimisationDict new file mode 100644 index 0000000000..339c20d9a8 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/optimisationDict @@ -0,0 +1,104 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/reEval/system/snappyHexMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/snappyHexMeshDict new file mode 100644 index 0000000000..0a53a1dd07 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/snappyHexMeshDict @@ -0,0 +1,170 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2306 | +| \\ / 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/reEval/system/surfaceFeatureExtractDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/surfaceFeatureExtractDict new file mode 100644 index 0000000000..217d805539 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/reEval/system/surfaceFeatureExtractDict @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/system/blockMeshDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/blockMeshDict new file mode 100644 index 0000000000..cf1a9c019d --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/blockMeshDict @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/system/controlDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/controlDict new file mode 100644 index 0000000000..9bdde832a3 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/system/createPatchDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/createPatchDict new file mode 100644 index 0000000000..6bcb710b1c --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/createPatchDict @@ -0,0 +1,91 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/system/decomposeParDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/decomposeParDict new file mode 100644 index 0000000000..c9d397f65e --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/decomposeParDict @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 60; +method scotch; + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/fvOptions b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/fvOptions new file mode 100644 index 0000000000..4366c9361d --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/fvOptions @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/system/fvSchemes b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/fvSchemes new file mode 100644 index 0000000000..8153b470b6 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/fvSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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/system/fvSolution b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/fvSolution new file mode 100644 index 0000000000..245bf03f31 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/fvSolution @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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.*" 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/system/optimisationDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/optimisationDict new file mode 100644 index 0000000000..7725b9150d --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/optimisationDict @@ -0,0 +1,236 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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; + targetConstraintReduction 0.2; + preconditioner ShermanMorrison; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/topoSetDict b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/topoSetDict new file mode 100644 index 0000000000..0613289aa7 --- /dev/null +++ b/tutorials/incompressible/adjointOptimisationFoam/topologyOptimisation/monoFluidAero/laminar/3DBox/losses-mass-uniformity-SQP/system/topoSetDict @@ -0,0 +1,118 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2306 | +| \\ / 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); + } +); + +// ************************************************************************* //