ENH: runTime selectable disabling of matrix norm (#2500)

For example,

    T
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-6;
        norm            none;
    }

STYLE: define defaultMaxIter, defaultTolerance directly in lduMatrix
This commit is contained in:
Mark Olesen
2022-07-07 14:01:58 +02:00
parent ba49415d68
commit 6e393ccbc8
23 changed files with 380 additions and 214 deletions

View File

@ -0,0 +1,19 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
keepCases="pitzDaily"
loseCases="pitzDaily-stepFunction"
for caseName in $keepCases
do
foamCleanTutorials -case="$caseName"
done
for caseName in $loseCases
do
removeCase $caseName
done
#------------------------------------------------------------------------------

View File

@ -0,0 +1,36 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
# Do pitzDaily
( cd pitzDaily && foamRunTutorials )
if true ## if notTest "$@"
then
# Clone case for additional tests
cloneCase pitzDaily pitzDaily-stepFunction
# Modify and execute
(
cd pitzDaily-stepFunction || exit
# Run a bit longer
foamDictionary system/controlDict -entry endTime -set 0.2
# Use table input to start scalar at 0.1s
##runApplication changeDictionary -time 0
foamDictionary 0/T \
-entry boundaryField/inlet/uniformValue/type \
-set table
# Use 'none' for matrix norm
foamDictionary system/fvSolution \
-entry solvers/T/norm \
-set none
foamRunTutorials
)
fi
#------------------------------------------------------------------------------

View File

@ -22,28 +22,41 @@ boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
type uniformFixedValue;
uniformValue
{
type constant;
value 1.0;
// Table entries (for modified version)
values
(
(0 1e-12)
(0.1 1e-12)
(0.10001 1.0)
);
}
}
outlet
{
type zeroGradient;
type zeroGradient;
}
upperWall
{
type zeroGradient;
type zeroGradient;
}
lowerWall
{
type zeroGradient;
type zeroGradient;
}
frontAndBack
{
type empty;
type empty;
}
}

View File

@ -0,0 +1,41 @@
/*--------------------------------*- 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 changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
T
{
boundaryField
{
inlet
{
type uniformFixedValue;
uniformValue
{
type table;
values
(
(0 1e-12)
(0.1 1e-12)
(0.10001 20)
);
}
}
}
}
// ************************************************************************* //

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -20,8 +20,9 @@ solvers
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-06;
tolerance 1e-6;
relTol 0;
norm default;
}
}