ordinary |
November 17, 2018 15:07 |
Weird Courant Number Error in Couette Flow
Hello everyone,
I encounter incomprehensible Courant number errors and velocity magnitudes when I try to simulate 2D Couette flow.
U file:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ 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
{
movingWall
{
type fixedValue;
value uniform (1 0 0);
}
stationaryWall
{
type fixedValue;
value uniform (0 0 0);
}
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
p file
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
movingWall
{
type zeroGradient;
}
stationaryWall
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 0;
}
outlet
{
type fixedValue;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
blockMeshDict file
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(0 0 0)
(1 0 0)
(1 0.25 0)
(0 0.25 0)
(0 0 0.1)
(1 0 0.1)
(1 0.25 0.1)
(0 0.25 0.1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (400 400 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
movingWall
{
type wall;
faces
(
(3 7 6 2)
);
}
inlet
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet
{
type patch;
faces
(
(2 6 5 1)
);
}
stationaryWall
{
type wall;
faces
(
(1 5 4 0)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
controlDict file
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 3;
deltaT 0.001;
writeControl runTime;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
Courant number = u*DeltaT/DeltaX must be smaller than 1. My maximum velocity is 1 m/s which is at the moving wall. My DeltaX is 1/400=0.0025 m. So my DeltaT must be smaller than 0.0025. Thus, I set DeltaT to 0.001. So, how could this case give me an error and absurd velocity magnitutes like these:
Code:
Time = 0.044
Courant Number mean: 0.336637 max: 1944.94 velocity magnitude: 2431.17
BiCGStab: Solving for Ux, Initial residual = 0.972023, Final residual = 9.93918e-06, No Iterations 80
BiCGStab: Solving for Uy, Initial residual = 0.945448, Final residual = 6.14037e-06, No Iterations 82
DICPCG: Solving for p, Initial residual = 0.849381, Final residual = 9.71391e-07, No Iterations 521
time step continuity errors : sum local = 6.37445e-07, global = 9.354e-09, cumulative = 1.45292e-08
DICPCG: Solving for p, Initial residual = 0.920578, Final residual = 9.38132e-07, No Iterations 543
time step continuity errors : sum local = 9.62929e-06, global = 9.33402e-08, cumulative = 1.07869e-07
ExecutionTime = 133.78 s ClockTime = 134 s
Time = 0.045
Courant Number mean: 168.34 max: 1.37785e+06 velocity magnitude: 3.28688e+06
BiCGStab: Solving for Ux, Initial residual = 0.999994, Final residual = 3.24586e+18, No Iterations 1000
BiCGStab: Solving for Uy, Initial residual = 0.999935, Final residual = 3.48908e+16, No Iterations 1000
DICPCG: Solving for p, Initial residual = 1, Final residual = 2.42732e-08, No Iterations 3
time step continuity errors : sum local = 1.36528e+17, global = 1.55905e+10, cumulative = 1.55905e+10
DICPCG: Solving for p, Initial residual = 0.985689, Final residual = 1.29964e-08, No Iterations 3
time step continuity errors : sum local = 1.3758e+17, global = -3.67509e+13, cumulative = -3.67353e+13
ExecutionTime = 148.01 s ClockTime = 148 s
Time = 0.046
Courant Number mean: 6.45818e+24 max: 6.04572e+27 velocity magnitude: 1.51143e+28
Floating point exception (core dumped)
Any idea is appreciated.
Sincerely,
ordinary
|