バージョン2306で確認した。
インプットファイルの比較
比較図は左がinterFoamで右がinterIsoFoamのチュートリアルケース。
0.orig/alpha.water
空白行の有り無しくらいの差でインプットに違いはない。
0.orig/p_rgh
0.orig/U
constant/dynamicMeshDict
interIsoFoamにはdynamicMeshDictがある。
/*--------------------------------*- 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;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh staticFvMesh;
// ************************************************************************* //
constant/g
細かい記述の違いはあるがキーワード数値に大きな違いはない。
constant/transportProperties
細かい記述の違いはあるがキーワード数値に大きな違いはない。
constant/turbulenceProperties
細かい記述の違いはあるがキーワード数値に大きな違いはない。
system/blockMeshDict
system/controlDict
system/decomposeParDict
違いなし。
system/fvSchemes
system/fvSolution
system/setFieldsDict
特に違いなし。
system/sampling
interFoamのチュートリアルにだけ存在。
それぞれのチュートリアルケースを入れ替えて実行
interFoamのチュートリアルケースをinterIsoFoamで実行
チュートリアル実行のためにAllrunを書き換え
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication setFields
runApplication interIsoFoam
#------------------------------------------------------------------------------
計算は実行できた。
Courant Number mean: 0.180077 max: 0.911563
Interface Courant Number mean: 0.0106017 max: 0.669282
deltaT = 0.0026925
Time = 1
PIMPLE: iteration 1
isoAdvection: After conservative bounding: min(alpha) = 0, max(alpha) = 1 + 8.49821e-08
Phase-1 volume fraction = 0.127565 Min(alpha.water) = 0 Max(alpha.water) = 1
DICPCG: Solving for p_rgh, Initial residual = 0.0388851, Final residual = 0.00110888, No Iterations 2
time step continuity errors : sum local = 0.00122878, global = 4.39984e-07, cumulative = 0.00276999
DICPCG: Solving for p_rgh, Initial residual = 0.00133789, Final residual = 5.10775e-05, No Iterations 19
time step continuity errors : sum local = 5.61667e-05, global = -1.21574e-05, cumulative = 0.00275783
DICPCG: Solving for p_rgh, Initial residual = 0.000286543, Final residual = 7.53089e-08, No Iterations 59
time step continuity errors : sum local = 8.31681e-08, global = 3.88184e-09, cumulative = 0.00275783
ExecutionTime = 9.25 s ClockTime = 26 s
End
log.interIsoFoamを確認。
fvSolution.solvers.alpha.water.*にreconstructionSchemeがないためデフォルトを使うとワーニング。
No finite volume options present
--> FOAM Warning : Entry 'reconstructionScheme' not found in dictionary "/mnt/c/Users/hamma/Documents/97thOpenCAE/damBreak_interFoam_OF2306_laminar/damBreak/system/fvSolution.solvers.alpha.water.*"
using default
そのほかもinterIsoFoamに関するワーニングが3つほど表示された。
PIMPLE: iteration 1
--> FOAM Warning :
From void Foam::cutFaceAdvect::cutPoints(Foam::label, Foam::scalar, Foam::DynamicList<Foam::Vector<double> >&)
in file cellCuts/cutFace/cutFaceAdvect.C at line 927
cutPoints = 4((0.457052 0.443619 0) (0.457052 0.456381 0) (0.457052 0.456381 0.0146) (0.457052 0.443619 0.0146)) for pts = 4((0.457052 0.443619 0) (0.457052 0.456381 0) (0.457052 0.456381 0.0146) (0.457052 0.443619 0.0146)), f - f0 = 4(3729 3748 4546 4527) and f0 = 9.59456e-08
差は出ているのでinterIsoFoamの影響は出ていそう。
最後にinterIsoFoamの結果を示す。こちらはメッシュの分割数も違うのでより、界面がはっきりしている。
interIsoFoamのチュートリアルケースをinterFoamで実行
Allrunを次のように修正
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication setFields
runApplication interFoam
foamSequenceVTKFiles -vtp
#------------------------------------------------------------------------------
interFoamの実行時にエラーが発生。
PIMPLE: iteration 1
--> FOAM FATAL IO ERROR: (openfoam-2306)
Entry 'nAlphaCorr' not found in dictionary "/mnt/c/Users/hamma/Documents/97thOpenCAE/damBreak_interIsoFoam_OF2306/system/fvSolution.solvers.alpha.water.*"
file: system/fvSolution.solvers.alpha.water.* at line 22 to 31.
From bool Foam::dictionary::readEntry(const Foam::word&, T&, Foam::keyType::option, Foam::IOobjectOption::readOption) const [with T = int]
in file ./src/OpenFOAM/lnInclude/dictionaryTemplates.C at line 327.
FOAM exiting
fvSolutionを見ると、nAlphaCorrは確かにない。
solvers
{
"alpha.water.*"
{
isoFaceTol 1e-6;
surfCellTol 1e-6;
nAlphaBounds 3;
snapTol 1e-12;
clip true;
reconstructionScheme isoAlpha;
writeFields true;
nAlphaSubCycles 1;
cAlpha 1; // Note: cAlpha is not used by isoAdvector but must
// be specified because interfacePropertes object
// reads it during construction.
}
interFoamのチュートリアルからnAlphaCorrをfvSolutionに移植。
"alpha.water.*"
{
isoFaceTol 1e-6;
surfCellTol 1e-6;
nAlphaBounds 3;
snapTol 1e-12;
clip true;
reconstructionScheme isoAlpha;
writeFields true;
nAlphaCorr 2;
nAlphaSubCycles 1;
cAlpha 1; // Note: cAlpha is not used by isoAdvector but must
// be specified because interfacePropertes object
// reads it during construction.
}
interFoam実行時にエラーが出る。
PIMPLE: iteration 1
--> FOAM FATAL IO ERROR: (openfoam-2306)
Entry 'div(phirb,alpha)' not found in dictionary "system/fvSchemes.divSchemes"
file: system/fvSchemes.divSchemes at line 30 to 31.
From const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, Foam::keyType::option) const
in file db/dictionary/dictionary.C at line 375.
FOAM exiting
fvSchemesにinterFoamチュートリアルからdiv(phirb,alpha)を移植
divSchemes
{
div(rhoPhi,U) Gauss limitedLinearV 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(phirb,alpha) Gauss linear;
}
interFoamでエラー発生。
--> FOAM FATAL IO ERROR: (openfoam-2306)
Entry 'div(phi,alpha)' not found in dictionary "system/fvSchemes.divSchemes"
file: system/fvSchemes.divSchemes at line 30 to 32.
From const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, Foam::keyType::option) const
in file db/dictionary/dictionary.C at line 375.
FOAM exiting
fvSchemesにdiv(phi,alpha)を追記。(interFoamのインプットから移植)
divSchemes
{
div(rhoPhi,U) Gauss limitedLinearV 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(phirb,alpha) Gauss linear;
div(phi,alpha) Gauss vanLeer;
}
interFoamは少し実行されるが途中でエラーになる。
Time = 0.02
PIMPLE: iteration 1
MULES: Solving for alpha.water
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.124769 Min(alpha.water) = -4.34239e-18 Max(alpha.water) = 1
GAMG: Solving for p_rgh, Initial residual = 0.0309471, Final residual = 0.000186698, No Iterations 1
time step continuity errors : sum local = 0.000781576, global = 6.37278e-07, cumulative = -1.57561e-06
GAMG: Solving for p_rgh, Initial residual = 0.000196838, Final residual = 4.60438e-06, No Iterations 4
time step continuity errors : sum local = 1.88526e-05, global = 5.8965e-06, cumulative = 4.32089e-06
GAMG: Solving for p_rgh, Initial residual = 9.95014e-06, Final residual = 5.28705e-10, No Iterations 12
time step continuity errors : sum local = 2.17348e-09, global = 2.07228e-09, cumulative = 4.32296e-06
ExecutionTime = 0.52 s ClockTime = 1 s
--> FOAM FATAL ERROR: (openfoam-2306)
failed lookup of reconstructionScheme (objectRegistry region0)
available objects of type reconstructionSchemes:
0()
From const Type& Foam::objectRegistry::lookupObject(const Foam::word&, bool) const [with Type = Foam::reconstructionSchemes]
in file ./src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 571.
FOAM exiting
reconstructionScheme で何かが起きているので、fvSolutionでコメントアウト。
"alpha.water.*"
{
isoFaceTol 1e-6;
surfCellTol 1e-6;
nAlphaBounds 3;
snapTol 1e-12;
clip true;
//reconstructionScheme isoAlpha;
writeFields true;
nAlphaCorr 2;
nAlphaSubCycles 1;
cAlpha 1; // Note: cAlpha is not used by isoAdvector but must
// be specified because interfacePropertes object
// reads it during construction.
}
エラーメッセージは変わらなかった。
インプット比較で差があった部分を中心に再確認する。計算が走ってから途中で発散せずに落ちていることからcontrolDictのfunctionsを疑う。functionsの中をコメントアウトする。
functions
{
// surfaces
// {
// type surfaces;
// libs (geometricVoF sampling);
// writeControl writeTime;
// surfaceFormat vtp;
// fields (p U);
// interpolationScheme cell;
// surfaces
// {
// freeSurf
// {
// type interface;
// interpolate false;
// }
// }
// }
}
計算は進むようになったが、途中でエラー終了した。
Courant Number mean: 0.188855 max: 0.879953
Interface Courant Number mean: 0.0115789 max: 0.493851
deltaT = 0.000869565
Time = 0.265217
PIMPLE: iteration 1
MULES: Solving for alpha.water
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.124769 Min(alpha.water) = -0.00189022 Max(alpha.water) = 1
GAMG: Solving for p_rgh, Initial residual = 0.0772416, Final residual = 0.000910686, No Iterations 1
time step continuity errors : sum local = 0.000316055, global = -4.90856e-06, cumulative = 0.000170627
GAMG: Solving for p_rgh, Initial residual = 0.00104247, Final residual = 2.25071e+134, No Iterations 1000
time step continuity errors : sum local = 7.82347e+133, global = -5.11591e+130, cumulative = -5.11591e+130
[stack trace]
=============
#1 Foam::sigFpe::sigHandler(int) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#2 ? in /lib/x86_64-linux-gnu/libc.so.6
#3 Foam::scalarProduct<double, double>::type Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#4 Foam::PCG::scalarSolve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#5 Foam::GAMGSolver::solveCoarsestLevel(Foam::Field<double>&, Foam::Field<double> const&) const in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#6 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#7 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
#8 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#9 ? in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#10 Foam::fvMesh::solve(Foam::fvMatrix<double>&, Foam::dictionary const&) const in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so
#11 ? in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/bin/interFoam
#12 ? in /lib/x86_64-linux-gnu/libc.so.6
#13 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#14 ? in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/bin/interFoam
=============
Floating point exception
controlDictのfunctionsが原因だとわかったので、fvSolutionのreconstructionSchemeも元に戻す。
計算が落ちるタイミングは変わらなかった。
エラー前のステップのログを見ると、エラーが発生したのはp_rghの3回目の計算のところだとわかる。
Courant Number mean: 0.187632 max: 0.889183
Interface Courant Number mean: 0.011652 max: 0.496776
deltaT = 0.000869565
Time = 0.264348
PIMPLE: iteration 1
MULES: Solving for alpha.water
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.124769 Min(alpha.water) = -0.00188413 Max(alpha.water) = 1
GAMG: Solving for p_rgh, Initial residual = 0.0652241, Final residual = 0.000764112, No Iterations 1
time step continuity errors : sum local = 0.000244135, global = -6.56321e-06, cumulative = 0.000174323
GAMG: Solving for p_rgh, Initial residual = 0.00085468, Final residual = 2.80426e-05, No Iterations 3
time step continuity errors : sum local = 9.07342e-06, global = 1.21197e-06, cumulative = 0.000175535
GAMG: Solving for p_rgh, Initial residual = 0.000138136, Final residual = 8.80191e-10, No Iterations 15
time step continuity errors : sum local = 2.84353e-10, global = -7.01505e-11, cumulative = 0.000175535
ExecutionTime = 14.69 s ClockTime = 22 s
Courant Number mean: 0.188855 max: 0.879953
Interface Courant Number mean: 0.0115789 max: 0.493851
deltaT = 0.000869565
Time = 0.265217
PIMPLE: iteration 1
MULES: Solving for alpha.water
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.124769 Min(alpha.water) = -0.00189022 Max(alpha.water) = 1
GAMG: Solving for p_rgh, Initial residual = 0.0772416, Final residual = 0.000910686, No Iterations 1
time step continuity errors : sum local = 0.000316055, global = -4.90856e-06, cumulative = 0.000170627
GAMG: Solving for p_rgh, Initial residual = 0.00104247, Final residual = 2.25071e+134, No Iterations 1000
time step continuity errors : sum local = 7.82347e+133, global = -5.11591e+130, cumulative = -5.11591e+130
[stack trace]
=============
#1 Foam::sigFpe::sigHandler(int) in /usr/lib/openfoam/openfoam2306/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so
感覚的にfvSolutionが怪しい気がしたので、interFoamのチュートリアルにあるrelaxationFactorsを移植する。
PIMPLE
{
momentumPredictor no;
nCorrectors 3;
nOuterCorrectors 1;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
equations
{
".*" 1;
}
}
計算が実行できた。