potentialFoamのエラー

660 views
Skip to first unread message

SLions

unread,
Dec 7, 2011, 10:11:54 AM12/7/11
to OpenFOAM
皆様、はじめまして。
初投稿させて頂きます。

simpleFoamを実行する前にpotentialFoamを実行しておこうと思うのですが、以下のエラーが出てきてしまいます。

--> FOAM FATAL ERROR:
No valid model for viscous stress calculation.

From function forces::devRhoReff()
in file forces/forces.C at line 113.

使用しているOpenFOAMのヴァージョンは2.0.1です。
forces.Cを見てみましたが、関係ありそうなRASPropertiesとtransportPropertiesを記述しておりますし、何故こ
のエラーが出てしまうのかわかりません。

どなたか解決法をご存じの方はいらっしゃいますでしょうか?

ohbuchi

unread,
Dec 8, 2011, 4:52:58 AM12/8/11
to OpenFOAM
こんにちは。
エラーメッセージは、potentialFoamの出力したものでは無いように見えます。
forcesは多分、functionObjectのものではないでしょうか?
私の試したケースでは、controlDictにfunctions、forcesのあるsimpleFoamの場合でも
potentialFoamは問題なく実行できました。
fvSolutionでpotentialFlowを定義し、fvSchemesでpのラプラシアンスキームを定義する
ことは必要でしたが。

実行されたコマンドや、controlDictなどを示して頂けないと原因がつかめないと思います。

Masashi Imano

unread,
Dec 8, 2011, 5:15:01 AM12/8/11
to open...@googlegroups.com
今野です。

横から失礼しますが、forcesのfunctionObjectは乱流モデルのライブラリ
が必要なのに、potentialFoamには乱流モデルが当然リンクされていないので、
controlDictに

libs
(
"libcompressibleTurbulenceModels.so"
"libincompressibleRASModels.so"
);

などと動的にリンクするよう書かないといけない、ということではないでしょうか?
外していたらごめんなさい。

2011/12/8 ohbuchi <ohb...@amber.plala.or.jp>:

> --
> このメールは Google グループのグループ「OpenFOAM」の登録者に送られています。
> このグループに投稿するには、open...@googlegroups.com にメールを送信してください。
> このグループから退会するには、openfoam+u...@googlegroups.com にメールを送信してください。
> 詳細については、http://groups.google.com/group/openfoam?hl=ja からこのグループにアクセスしてください。
>

--
IMANO Masashi, Ph.D.
Assistant Professor
Department of Architecture, Graduate School of Engineering,
The University of Tokyo
7-3-1, Hongo, Bunkyo-ku, Tokyo, Japan, 113-8656
E-mail:im...@arch.t.u-tokyo.ac.jp
Phone:+81-3-5841-6164(direct), +81-3-5841-6179(Laboratory)
Facsimile:+81-3-5841-8511

SLions

unread,
Dec 8, 2011, 7:18:42 AM12/8/11
to OpenFOAM
ohbuchi様、今野様
返信ありがとうございます。

ご指摘の通り、controlDict内にfunctionにてforces等の記述をしております。

実行コマンドはpotentialFoamで間違いありません。

出力結果、controlDict,fvSchemes,fvSolutionを示します。

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U


Calculating potential flow
GAMG: Solving for p, Initial residual = 1, Final residual =
0.0163116, No Iterations 1
GAMG: Solving for p, Initial residual = 0.911047, Final residual =
0.0516651, No Iterations 1
GAMG: Solving for p, Initial residual = 0.560676, Final residual =
0.0443465, No Iterations 1
GAMG: Solving for p, Initial residual = 0.303242, Final residual =
0.0149394, No Iterations 2
GAMG: Solving for p, Initial residual = 0.267035, Final residual =
0.0225342, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0846223, Final residual =
0.0081299, No Iterations 3
GAMG: Solving for p, Initial residual = 0.170364, Final residual =
0.00964379, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0329071, Final residual =
0.00225851, No Iterations 2
GAMG: Solving for p, Initial residual = 0.0362738, Final residual =
0.00186999, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0115168, Final residual =
0.000674837, No Iterations 2
GAMG: Solving for p, Initial residual = 0.0219317, Final residual =
0.000847044, No Iterations 2
continuity error = 0.429094
Interpolated U error = 0.000143875


--> FOAM FATAL ERROR:
No valid model for viscous stress calculation.

From function forces::devRhoReff()
in file forces/forces.C at line 113.

FOAM exiting

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * //


FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * //

application simpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 1;

deltaT 0.01;

writeControl timeStep;

writeInterval 10;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;


functions
(

forces
{
type forces;
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
outputInterval 1;
patches (body);
pName p;
UName U;
rhoName rhoInf;
log true;
rhoInf 1.225;
CofR (0.25 0.007 0.125);
}

forceCoeffs
{
type forceCoeffs;
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
outputInterval 1;
patches (body);
pName p;
UName U;
rhoName rhoInf;
log true;
rhoInf 1.225;
CofR ( 0 0 0 );
liftDir ( 0 1 0 );
dragDir ( 0 0 1 );
pitchAxis ( 1 0 0 );
magUInf 20.0;
lRef 1;
Aref 1;
}


);


//
************************************************************************* //

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * //

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
// grad(U) cellLimited Gauss linear 1;
}

divSchemes
{
default none;
// div(phi,U) Gauss linearUpwindV Gauss linear;
div(phi,U) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
// default Gauss linear limited 0.5;
// default Gauss linear limited 0.333;

laplacian(DomegaEff,omega) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}

//
************************************************************************* //


FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * //

solvers
{
p
{
solver GAMG;
tolerance 1e-7;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
};

U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
};

k
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
};

epsilon
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
};
omega
{
//solver PBiCG;
solver smoothSolver;
//preconditioner DILU;
smoother GaussSeidel;
//tolerance 1e-05;
tolerance 1e-8;
//relTol 0.1;
relTol 0.1;
nSweeps 1;
};
}

SIMPLE
{
nNonOrthogonalCorrectors 0;
residualControl
{
p 1e-2;
U 1e-2;
"(k|omega)" 1e-2;
}
}

potentialFlow
{
nNonOrthogonalCorrectors 10;
}

relaxationFactors
{
p 0.3;
U 0.7;
k 0.7;
epsilon 0.7;
omega 0.7;
}

//
************************************************************************* //


これらに対して、お二方のご指摘および他の例から、fvSchemesには、
laplacian(nu,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
を追加。
controlDictには、
libs
(
"libOpenFOAM.so"
"libcompressibleTurbulenceModels.so"
"libincompressibleRASModels.so"
);
を追加しました。

追加後の出力は以下の通りです。

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * //
Create time

--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line
96
could not load "libcompressibleTurbulenceModels.so"
Create mesh for time = 0

Reading field p

Reading field U


Calculating potential flow
GAMG: Solving for p, Initial residual = 1, Final residual =
0.0163116, No Iterations 1
GAMG: Solving for p, Initial residual = 0.911047, Final residual =
0.0516651, No Iterations 1
GAMG: Solving for p, Initial residual = 0.560676, Final residual =
0.0443465, No Iterations 1
GAMG: Solving for p, Initial residual = 0.303242, Final residual =
0.0149394, No Iterations 2
GAMG: Solving for p, Initial residual = 0.267035, Final residual =
0.0225342, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0846223, Final residual =
0.0081299, No Iterations 3
GAMG: Solving for p, Initial residual = 0.170364, Final residual =
0.00964379, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0329071, Final residual =
0.00225851, No Iterations 2
GAMG: Solving for p, Initial residual = 0.0362738, Final residual =
0.00186999, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0115168, Final residual =
0.000674837, No Iterations 2
GAMG: Solving for p, Initial residual = 0.0219317, Final residual =
0.000847044, No Iterations 2
continuity error = 0.429094
Interpolated U error = 0.000143875


--> FOAM FATAL ERROR:
No valid model for viscous stress calculation.

From function forces::devRhoReff()
in file forces/forces.C at line 113.

FOAM exiting

もしやと思い、チュートリアルのmotorBikeでも試してみると、同様のFOAM FATAL ERRORが出ました。
何か根本的な部分で間違えている気がしてきました・・・

On 12月8日, 午後7:15, Masashi Imano <masashi.im...@gmail.com> wrote:
> 今野です。
>
> 横から失礼しますが、forcesのfunctionObjectは乱流モデルのライブラリ
> が必要なのに、potentialFoamには乱流モデルが当然リンクされていないので、
> controlDictに
>
> libs
> (
> "libcompressibleTurbulenceModels.so"
> "libincompressibleRASModels.so"
> );
>
> などと動的にリンクするよう書かないといけない、ということではないでしょうか?
> 外していたらごめんなさい。
>

> 2011/12/8 ohbuchi <ohbu...@amber.plala.or.jp>:

Masashi Imano

unread,
Dec 8, 2011, 7:30:03 AM12/8/11
to open...@googlegroups.com
今野です。

> もしやと思い、チュートリアルのmotorBikeでも試してみると、同様のFOAM FATAL ERRORが出ました。

私もmotorBikeのcontrolDictを参考に書き込んでしまったのですが、
良く見ると動的リンクの指定に、何故か圧縮性と非圧縮性の乱流ライブラリが
交じって変ですね。

libs
(
"libOpenFOAM.so"
"libincompressibleTurbulenceModels.so"
"libincompressibleRASModels.so"
);

とすると如何でしょうか?

2011/12/8 SLions <matias...@gmail.com>:

ohbuchi

unread,
Dec 8, 2011, 11:29:37 AM12/8/11
to OpenFOAM
こんにちは。
今野先生のご指摘の様に変更すれば行けそうですね。
ただ、potentialFoamを実行するときだけfunctions以下を
コメントアウトすれば良いのかとも思われます。
U,pの初期値を得るだけが目的ですので。


On 12月8日, 午後9:30, Masashi Imano <masashi.im...@gmail.com> wrote:
> 今野です。
>

> > もしやと思い、チュートリアルのmotorBikeでも試してみると、同様のFOAM FATAL ERRORが出ました。
>
> 私もmotorBikeのcontrolDictを参考に書き込んでしまったのですが、
> 良く見ると動的リンクの指定に、何故か圧縮性と非圧縮性の乱流ライブラリが
> 交じって変ですね。
>
> libs
> (
> "libOpenFOAM.so"
> "libincompressibleTurbulenceModels.so"
> "libincompressibleRASModels.so"
> );
>
> とすると如何でしょうか?
>

> 2011/12/8 SLions <matiassch...@gmail.com>:

> ...
>
> もっと読む ≫

SLions

unread,
Dec 8, 2011, 10:18:21 PM12/8/11
to OpenFOAM
今野様

ご指摘の通り、乱流ライブラリを


libs
(
"libOpenFOAM.so"
"libincompressibleTurbulenceModels.so"
"libincompressibleRASModels.so"
);

とすると、エラー無くpotentialFoamが終了しました。ありがとうございます。

ohbuchi様

> ただ、potentialFoamを実行するときだけfunctions以下を
> コメントアウトすれば良いのかとも思われます。
> U,pの初期値を得るだけが目的ですので。

エラーメッセージにとらわれすぎておりました。
potentialFoamの本質からすると全くもってその通りですね。
今回はありがとうございました。

> > > GAMG: Solving for p,...
>
> もっと読む ≫

Masashi Imano

unread,
Dec 8, 2011, 10:27:09 PM12/8/11
to open...@googlegroups.com
今野です。

>> ただ、potentialFoamを実行するときだけfunctions以下を
>> コメントアウトすれば良いのかとも思われます。
>> U,pの初期値を得るだけが目的ですので。
>
> エラーメッセージにとらわれすぎておりました。
> potentialFoamの本質からすると全くもってその通りですね。

最初小生もpotentialFoam実行時とsimpleFoma実行時のcontrolDictの
書き換えは思いつきましたが、それも面倒だと思い、
乱流モデルライブラリの動的ロードを提案しました。

ただ、もう少しエレガントな解決法が無いか、moterBikeのAllrunを
見てみたら、

runApplication potentialFoam -noFunctionObjects -writep

とあったので、controlDictを修正しなくても、 -noFunctionObjects
のオプションを付けて、potentialFoamを実行すれば良いみたいですね。

2011/12/9 SLions <matias...@gmail.com>:

SLions

unread,
Dec 8, 2011, 11:24:40 PM12/8/11
to OpenFOAM
今野様

> runApplication potentialFoam -noFunctionObjects -writep

改めてpotentialFoamのオプションを見直す良い機会となりました。
今回の件、勉強になりました。ありがとうございます。


On 12月9日, 午後12:27, Masashi Imano <masashi.im...@gmail.com> wrote:
> 今野です。
>

> >> ただ、potentialFoamを実行するときだけfunctions以下を
> >> コメントアウトすれば良いのかとも思われます。
> >> U,pの初期値を得るだけが目的ですので。
>
> > エラーメッセージにとらわれすぎておりました。
> > potentialFoamの本質からすると全くもってその通りですね。
>
> 最初小生もpotentialFoam実行時とsimpleFoma実行時のcontrolDictの
> 書き換えは思いつきましたが、それも面倒だと思い、
> 乱流モデルライブラリの動的ロードを提案しました。
>
> ただ、もう少しエレガントな解決法が無いか、moterBikeのAllrunを
> 見てみたら、
>
> runApplication potentialFoam -noFunctionObjects -writep
>
> とあったので、controlDictを修正しなくても、 -noFunctionObjects
> のオプションを付けて、potentialFoamを実行すれば良いみたいですね。
>

> 2011/12/9 SLions <matiassch...@gmail.com>:

> >> > > smoother ...
>
> もっと読む ≫

Reply all
Reply to author
Forward
0 new messages