お世話になっております。現在大学院の研究にてopenfoam v2312を用いて燃焼解析を行っております.研究を行う中で,rhoReactingfoamの計算における化学種のソース項のみを出力できないかと思いCFDonline等を参考にソルバーの追記を行っています.createFields内に下記の追加を行ったところ,時刻ディレクトリにR_(化学種名)のファイルは出力されるのですが,中身が空のファイルになっています.
PtrList<volScalarField> Ri_;Ri_.setSize(Y.size());
forAll(Y, i)
{
Ri_.set
(
i,
new volScalarField
(
IOobject
(
"R_" + Y[i].name(),
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("Ri", dimensionSet(1, -3, -1, 0, 0, 0, 0), 0)
//reaction->R(Y[i]) & Y[i]
)
);
// if I write Ri_[i] = reaction->R(Y[i]); the compiler complains
Ri_[i] = reaction->R(Y[i]) & Y[i];
Ri_[i].write();
Info<< reaction->R(Y[i]) << endl;
}出力されたファイル
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2312 |
| \\ / A nd | Website:
www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format binary;
arch "LSB;label=32;scalar=64";
class volScalarField;
location "8.92992e-08";
object R_O2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 -1 0 0 0 0];
internalField uniform -0;
boundaryField
{
Wall
{
type calculated;
value nonuniform List<scalar> 0;
}
outlet
{
type calculated;
value uniform -0;
}
frontAndBack
{
type empty;
}
procBoundary1to0
{
type processor;
value uniform -0;
}
procBoundary1to2
{
type processor;
value uniform -0;
}
}
// ************************************************************************* //
どのようにしたらうまくソース項を出力できるか教えて頂けると幸いです.