TUT: tutorials for the new objective functions

TUT: moved the nutSqr objective tutorial to the proper directory
This commit is contained in:
Vaggelis Papoutsis
2022-11-23 15:10:41 +02:00
committed by Andrew Heather
parent 80f385a3b0
commit 599b009b18
238 changed files with 3996 additions and 0 deletions

View File

@ -0,0 +1,131 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2208 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
vertices
(
(0 0 0) //0
(0.1 0 0) //1
(0.1 0.05 0) //2
(0 0.05 0) //3
(0.1 0.1 0) //4
(0 0.1 0) //5
(0.2 -0.05 0) //6
(0.2 0 0) //7
(0.2 0.05 0) //8
(0.2 0.1 0) //9
(0.3 -0.05 0) //10
(0.3 0 0) //11
(0.3 0.05 0) //12
(0.3 0.1 0) //13
(0 0 -0.1) //0
(0.1 0 -0.1) //1
(0.1 0.05 -0.1) //2
(0 0.05 -0.1) //3
(0.1 0.1 -0.1) //4
(0 0.1 -0.1) //5
(0.2 -0.05 -0.1) //6
(0.2 0 -0.1) //7
(0.2 0.05 -0.1) //8
(0.2 0.1 -0.1) //9
(0.3 -0.05 -0.1) //10
(0.3 0 -0.1) //11
(0.3 0.05 -0.1) //12
(0.3 0.1 -0.1) //13
);
blocks
(
hex (0 1 15 14 3 2 16 17) (50 1 50) simpleGrading (1 1 1.5 )
hex (3 2 16 17 5 4 18 19) (50 1 50) simpleGrading (1 1 0.667)
hex (1 6 20 15 2 7 21 16) (50 1 50) simpleGrading (1 1 1.5)
hex (2 8 22 16 4 9 23 18) (50 1 50) simpleGrading (1 1 0.667)
hex (6 10 24 20 7 11 25 21) (50 1 50) simpleGrading (1 1 1.5)
hex (8 12 26 22 9 13 27 23) (50 1 50) simpleGrading (1 1 0.667)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(3 0 14 17)
(5 3 17 19)
);
}
outlet1
{
type patch;
faces
(
(12 13 27 26)
);
}
outlet2
{
type patch;
faces
(
(10 11 25 24)
);
}
upperWall
{
type wall;
faces
(
(4 18 23 9)
(5 19 18 4)
(9 23 27 13)
);
}
lowerWall
{
type wall;
faces
(
(0 1 15 14)
(1 6 20 15)
(6 10 24 20)
);
}
middleWall
{
type wall;
faces
(
(2 16 21 7)
(7 21 25 11)
(2 8 22 16)
(8 12 26 22)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2208 |
| \\ / 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 5;
deltaT 1;
writeControl timeStep;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 16;
writeCompression on;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2208 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
distributed no;
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2208 |
| \\ / 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;
}
divSchemes
{
default Gauss linear;
div(phi,U) bounded Gauss linearUpwind gradUConv;
div(-phi,Ua) bounded Gauss linearUpwind gradUaConv;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2208 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"p|pa.*|ma"
{
solver GAMG;
tolerance 1e-15;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}
"U|Ua.*"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-15;
relTol 0.1;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
fields
{
p 0.3;
"pa.*" 0.3;
}
equations
{
U 0.7;
"Ua.*" 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,117 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2208 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object optimisationDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
optimisationManager steadyOptimisation;
primalSolvers
{
p1
{
active true;
type incompressible;
solver simple;
solutionControls
{
nIters 3000;
residualControl
{
"p.*" 1.e-7;
"U.*" 1.e-7;
}
}
}
}
adjointManagers
{
am1
{
primalSolver p1;
adjointSolvers
{
as1
{
// choose adjoint solver
//----------------------
active true;
type incompressible;
solver adjointSimple;
// manage objectives
//------------------
objectives
{
type incompressible;
objectiveNames
{
flowRate
{
weight -1; // maximize
type flowRate;
patches (outlet1);
normalize true;
}
}
}
// ATC treatment
//--------------
ATCModel
{
ATCModel standard;
}
// solution control
//------------------
solutionControls
{
nIters 3000;
residualControl
{
"pa.*" 1.e-7;
"Ua.*" 1.e-7;
}
}
}
}
}
}
optimisation
{
optimisationType
{
type shapeOptimisation;
writeEachMesh true;
}
sensitivities
{
type volumetricBSplinesFI;
patches (upperWall lowerWall middleWall);
}
updateMethod
{
method conjugateGradient;
}
meshMovement
{
type volumetricBSplines;
maxAllowedDisplacement 1.e-3;
}
}
// ************************************************************************* //