TUT: minor tutorial cleanup

- use functionObject writeInterval not timeInterval.
  No change in behaviour since the missing writeInterval is treated
  as '1' anyhow when using 'timeStep' for the writeControl

- consistent use of 'adjustable' vs 'adjustableRunTime'

- prefer '#eval{ vector(...) }' to calling '#eval' multiple times
This commit is contained in:
Mark Olesen
2025-06-03 09:05:11 +02:00
parent ffea136955
commit 9e8e14e448
27 changed files with 75 additions and 84 deletions

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ stopAt writeNow;
endTime 4;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.1;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,7 @@ endTime 0.1;
deltaT 0.0001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 12000;
deltaT 1;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 100;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 0.28;
deltaT 0.02;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.002;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -14,29 +14,31 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// calculate inflow velocity vector
AoA 13.87;
Ux #eval{ cos(degToRad($AoA)) };
Uz #eval{ sin(degToRad($AoA)) };
AoA 13.87; // Angle-of-attack (deg)
magUInf 1.0; // Freestream velocity (m/s)
inletVelocity #eval{
$magUInf * vector(cos(degToRad($AoA)), 0, sin(degToRad($AoA)))
};
dimensions [0 1 -1 0 0 0 0];
internalField uniform ($Ux 0 $Uz);
internalField uniform $inletVelocity;
boundaryField
{
inlet
{
type inletOutlet;
inletValue uniform ($Ux 0 $Uz);
value uniform ($Ux 0 $Uz);
inletValue $internalField;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue uniform ($Ux 0 $Uz);
value uniform ($Ux 0 $Uz);
inletValue $internalField;
value $internalField;
}
aerofoil

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -13,11 +13,11 @@ forceCoeffs
libs (forces);
writeControl timeStep;
timeInterval 1;
writeInterval 1;
log no;
AoA 13.87; // Angle-of-attack
AoA 13.87; // Angle-of-attack (deg)
magUInf 1.0; // Freestream velocity
lRef 1.0; // Chord length
Aref #eval{ $lRef*0.004 }; // Chord length times span width
@ -25,16 +25,8 @@ forceCoeffs
patches (aerofoil);
rho rhoInf; // Indicates incompressible
rhoInf 1; // Required when rho = rhoInf
liftDir (
#eval{-sin(degToRad($AoA))}
0
#eval{cos(degToRad($AoA))}
);
dragDir (
#eval{cos(degToRad($AoA))}
0
#eval{sin(degToRad($AoA))}
);
liftDir #eval{vector( -sin(degToRad($AoA)), 0, cos(degToRad($AoA)) )};
dragDir #eval{vector( cos(degToRad($AoA)), 0, sin(degToRad($AoA)) )};
CofR (0.25 0 0); // Aerodynamic center point
pitchAxis (0 1 0);
}

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,8 @@ endTime 0.4;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;
purgeWrite 0;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -12,7 +12,7 @@ forces
libs (forces);
writeControl timeStep;
timeInterval 1;
writeInterval 1;
patches ("propeller.*");
rho rhoInf; // Indicates incompressible

View File

@ -30,7 +30,7 @@ patch
libs (sampling);
surfaceFormat boundaryData;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.1;
interpolationScheme cell;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 0.2;
deltaT 1e-3;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.1;
@ -67,17 +67,8 @@ functions
AMI2
{
type surfaceFieldValue;
libs (fieldFunctionObjects);
log true;
executeControl timeStep;
executeInterval 1;
writeFields true;
regionType patch;
${../AMI1}
name AMI2;
operation sum;
surfaceFormat none;
fields (phi);
}
forces
@ -85,7 +76,7 @@ functions
type forces;
libs (forces);
writeControl timeStep;
timeInterval 1;
writeInterval 1;
log yes;
patches ( "rotor" );
pName p;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -13,7 +13,7 @@ forceCoeffs1
libs (forces);
writeControl timeStep;
timeInterval 1;
writeInterval 1;
log yes;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,8 @@ endTime 0.4;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;
purgeWrite 0;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,8 @@ endTime 0.4;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;
purgeWrite 0;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,8 @@ endTime 0.4;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;
purgeWrite 0;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,8 @@ endTime 0.4;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;
purgeWrite 0;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,8 @@ endTime 0.4;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;
purgeWrite 0;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 25;
deltaT 1e-3;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.5;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 0.5;
deltaT 0.0001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 0.5;
deltaT 0.0001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.01;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 3;
deltaT 1e-3;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.1;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 100;
deltaT 1e-3;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 5;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 20;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.5;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 10;
deltaT 0.005;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.1;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -28,7 +28,7 @@ endTime 4;
deltaT 1e-5;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.25;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 50;
deltaT 1e-5;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 5;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -27,7 +27,7 @@ endTime 50;
deltaT 1e-5;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 5;

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2412 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -26,7 +26,7 @@ endTime 4;
deltaT 0.001;
writeControl adjustableRunTime;
writeControl adjustable;
writeInterval 0.05;