@李东岳 李老师,该问题已经解决,是由于部分的options文件多了这一行,导致编译的时候标准不同了。
但是在调试算例的时候又出现了如下问题,应该是src中lagrangian有一部分存在问题,但是目前我没找到具体的问题出在哪,不知道是不是版本不同编译导致的?
Rachel0096
帖子
-
-
各位老师,我想请教在编译求解器的时候出现如下错误应该如何解决:
* -lm -o /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/bin/coalFPVFoam * /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/lib/libFlameletPCClagrangianIntermediate.so: undefined reference to `Foam::UOPstream::writeQuoted(std::string const&, bool)' * /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/lib/libFlameletPCClagrangianIntermediate.so: undefined reference to `Foam::regExp::match(std::string const&) const' * /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/lib/libFlameletPCClagrangianIntermediate.so: undefined reference to `Foam::regExp::regExp(std::string const&, bool)' * collect2: error: ld returned 1 exit status * make: *** [/share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/bin/coalFPVFoam] Error 1
我编译的该求解器是在of6上编写的,我尝试修改之后在of7上进行编译,结果出现上述问题。
以下是求解器的options文件:
-
自问自答一下,可以参考cfd-online上的这个帖子
https://www.cfd-online.com/Forums/openfoam-bugs/194353-mapfields-major-bug.html
OpenFoam通过反向距离插值(reverse distance interpolation)来实现插值This interpolation will crash if point from which we interpolate and point interpolate to overlaps. So in OpenFOAM code this interpolation used only if distance between points is larger than directHitTol variable.
src/sampling/meshToMesh0/calculateMeshToMesh0Weights.C文件中directHitTol默认为10e-5,将其修改为10e-10🌟可以解决我遇到的这个报错
-
各位老师,我要计算一个比较大的网格,大概是九千万左右的网格数,一开始设置了一个比较粗的网格,计算了一段时间以后想要映射到这个细网格上面,但是在超算上面映射会报错,想问一下各位老师知道是什么原因吗?
我用的命令是:mapFields ../JICF -consistent
还有相请教一下mapFields如何多核并行映射呢,采用-parallel
会显示没有这个option
(现在真的太慢了) -
我的
chemistryProperties
是这样设置的:chemistryType { chemistrySolver ode; chemistryThermo psi; } chemistry on; initialChemicalTimeStep 1e-8; EulerImplicitCoeffs { cTauChem 1; equilibriumRateLimiter off; } odeCoeffs { solver seulex; absTol 1e-12; relTol 1e-1; } // ************************************************************************* //
-
请教一下,我用sprayFoam求解器跑了一晚上之后报了这个错是什么原因呀?:134
-
@李东岳 老师你好,是可压缩的算例,我在计算的后期修改求解器的代码输出了rho,现在想通过后处理手段补上前期时刻的rho
-
我是个openfoam新手,请教一下各位老师:
我的算例计算时没有输出密度rho,在计算结束后,还有办法输出吗?
-
采用“method simple”分区时,每个核分到的网格,是怎么确定的?
我在处理一个很大的算例(三亿网格),用reconstructPar合并数据太慢了,我想直接对每个processor*文件夹中的数据处理,必要时可以自己用编程语言合并场(数组的变形和拼接)。
我用简单的算例测试了一下,还是没有搞清楚,“method simple”给每个核分配网格的方法,在此请教一下各位老师和同学、同僚。
-
不知道各位老师有没有看过米兰理工Cuoci教授的《DropletSMOKE++: A comprehensive multiphase CFD framework for the evaporation of multidimensional fuel droplets》,他研究了燃料液滴蒸发,但他的YEqn.H方程我有点不太明白,有兴趣的老师可以分享一下自己的见解嘛~
YEqn.H
:/*---------------------------------------------------------------------------------------------------------------------------*\ Description Based on Banerjee et.al. (2013) the saturation mass fraction equation is solved. It is assumed that all the liquid phase has the saturation interfacial concentration and it diffuses from all the volume. Afterwards the liquid concentration is posed = 1 (for monocomponent cases). \*----------------------------------------------------------------------------------------------------------------------------*/ // Mass Fluxes #include "correctDiffusionFluxes.H" if(speciesEquations == true) { double tStart = OpenSMOKE::OpenSMOKEGetCpuTime(); // Convection discretization schemes tmp<fv::convectionScheme<scalar> > mvConvection ( fv::convectionScheme<scalar>::New ( mesh, fields, rhoPhi, mesh.divScheme("div(rhoPhi,Yi)") ) ); volScalarField Yt = 0.0*Y[0]; // Solving transport equations for the saturation mass fraction of liquid species Ysat for (label i=0; i<NLS; i++) { volScalarField& Yi = Y[LiquidSpeciesIndices(i)]; volScalarField& rhoDmixi = rhoDmix[LiquidSpeciesIndices(i)]; volScalarField& Keqi = Keq[i]; volScalarField& Ysati = Ysat[i]; volScalarField& Xsati = Xsat[i]; dimensionedScalar MWi( "Mi", dimensionSet(1,0,0,0,-1,0,0),thermodynamicsMapXML->MW(LiquidSpeciesIndices(i)) ); Ysati = alpha1*Keqi + alpha2*Ysati; /*---------------------------------------------------------------------------------------------------------------------------*\ Description The diffusion fluxes must be corrected with the molecular weight, because the diffusivity coefficients are molar-based. Having mass-fraction equation instead of a molar-fraction one, a MW correction is needed ( Transport Phenomena, p.534 ) \*----------------------------------------------------------------------------------------------------------------------------*/ volScalarField correctionMolarFluxes = rhoDmixi; if(mwCorrectionInDiffusionFluxes == true) { correctionMolarFluxes = rhoDmixi* 1./(MWsat*MWinert)* 1./ Foam::pow( Ysati/MWi+(1.-Ysati)/MWinert , 2.0); } // Solve liquid species equation fvScalarMatrix YsatiEqn ( fvm::ddt(rho, Ysati) + mvConvection->fvmDiv(rhoPhi, Ysati) - fvm::laplacian(correctionMolarFluxes, Ysati) == // - fvm::div(Jc,Ysati, "div(Jc,Ysati)") fvOptions(rho, Ysati) ); // Solve YsatiEqn.relax(); fvOptions.constrain(YsatiEqn); YsatiEqn.solve(mesh.solver("T")); fvOptions.correct(Ysati); Ysati = alpha1*Keqi + alpha2*Ysati; Xsati = Ysati/( MWi * (Ysati/MWi + (1.-Ysati)/MWinert) ); Yi = alpha1 + Ysati*alpha2; Yi.correctBoundaryConditions(); Yi.max(0.0); Yt += Yi; } // Solving transport equations for the gas species (not entering the liquid phase, like O2, CO2, reaction products...) for (label i=0; i<NGS; i++) { volScalarField& Yi = Y[GasSpeciesIndices(i)]; volScalarField& rhoDmixi = rhoDmix[GasSpeciesIndices(i)]; volScalarField& Ygasi = Ygas[i]; Ygasi = alpha1*(1.0-sumYi)*GaseousInterfaceRatio[i]/(1.0+GaseousInterfaceRatio[i]) + alpha2*Ygasi; fvScalarMatrix YgasiEqn ( fvm::ddt(rho, Ygasi) + mvConvection->fvmDiv(rhoPhi, Ygasi) - fvm::laplacian(rhoDmixi, Ygasi) == fvOptions(rho, Ygasi) ); // Solve YgasiEqn.relax(); fvOptions.constrain(YgasiEqn); YgasiEqn.solve(mesh.solver("Yi")); fvOptions.correct(Ygasi); Ygasi = alpha1*(1.0-sumYi)*GaseousInterfaceRatio[i]/(1.0+GaseousInterfaceRatio[i]) + alpha2*Ygasi; Yi = alpha2*Ygasi; Yi.correctBoundaryConditions(); // Sum of mass fractions Yi.max(0.0); Yt += Yi; } Info << "Inert species is " << Y[inertIndex].name() << " with local index equal to " << inertIndex << endl; Y[inertIndex] = scalar(1.0) - Yt; Y[inertIndex].max(0.0); double tEnd = OpenSMOKE::OpenSMOKEGetCpuTime(); Info << "Transport equations of species solved in " << tEnd - tStart << " s " << endl; }
-
@Tens 您好,我参考了phaseScalarTransport.C的方法,人为地乘以了alpha来区分界面,您看这样合理嘛?但是在求解过程中,当来流温度过高时,会出现局部质量分数过大的问题,非常困惑
phaseScalarTransport.C
:if (phi.dimensions() == dimMass/dimTime) { const volScalarField& rho = mesh_.lookupObject<volScalarField>(rhoName_); while (control.correctNonOrthogonal()) { fvScalarMatrix PhiEqn ( fvm::laplacian(Phi, laplacianScheme) + fvc::ddt(rho, alpha) + fvc::div(alphaPhi) ); PhiEqn.solve(pName_); if (control.finalNonOrthogonalIter()) { alphaPhi += PhiEqn.flux(); } } if (alphaPhi.dimensions() == dimMass/dimTime) { const volScalarField& rho = mesh_.lookupObject<volScalarField>(rhoName_); for (int i=0; i<=nCorr_; i++) { fvScalarMatrix fieldEqn ( fvm::ddt(alpha, rho, s_) + fvm::div(alphaPhi, s_, divScheme) - fvm::laplacian ( fvc::interpolate(alpha)*fvc::interpolate(D), s_, laplacianScheme ) == fvOptions_(alpha, rho, s_) - fvm::ddt(residualAlpha_*rho, s_) + fvc::ddt(residualAlpha_*rho, s_) ); fieldEqn.relax(relaxCoeff); fvOptions_.constrain(fieldEqn); fieldEqn.solve(schemesField_); } if (!alphaSPtr_.valid()) { alphaSPtr_.set ( new volScalarField ( IOobject ( "alpha" + word(toupper(fieldName_[0])) + fieldName_(1, fieldName_.size() - 1), mesh_.time().timeName(), mesh_, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh_, dimensionedScalar(s_.dimensions(), Zero) ) ); } alphaSPtr_() = alpha*s_;//人为地乘以alpha
-
@Zhong-combustion 您好,请问您实现这个功能了嘛,可以交流一下吗~
-
各位老师,之前用的是
compressibleInterFoam
求解器来计算横射流雾化,后面以期做到燃烧,但由于水平有限,在添加组分方程时便遇到许多问题。
现在发现reactingTwoPhaseEulerFoam
,其本身就有YEqns.H
,并且据我现在初步了解他可以通过选定reactingPhaseModel
相模型来计算反应。This model represents a phase with multiple species and volumetric reactions.
想问一下如果用
reactingTwoPhaseEulerFoam
可以做液体横射流雾化燃烧嘛? -
@李东岳 李老师您好
我参考的组分方程中的扩散项采取了以下的形式:// convection + ( UseMvConvection ? mvConvection->fvmDiv(phi + phiVc, Yi) : fvm::div(phi + phiVc, Yi, "div(phi,Yi_h)") )
并且cfd-online中也有人指出:
“When I use separate but same scheme for these two variable ( fvm::div(phi, field) ), I found that the results is different with mvConvection ( mvConvection->fvmDiv(phi, field) ).”
所以或许mvConvection->fvmDiv(phi, Yi)
和fvm::div
有点区别,不知道您有没有研究过? -
目前想用一个类似sprayFoam的求解器,算一个旋流燃烧的算例。在喷入燃料前需要先通入空气,对冷态流场进行计算。但在冷态流场计算时,出现了部分高温、高压的小块出现,同时时间步变的很慢,无法继续正常计算,不知道各位有没有什么建议和指导
右边绿色区块为inlet,流入空气,仅有流向速度为20m/s(后方圆柱长度约为20mm)。紫色平面包括叶片为wall。
截取了某时间点的温度分布,出现明显高温小块(同时高压),且后续会持续上涨,无法正常计算。 -
@nbyjn 我扩大了沿射流方向的计算域,现在是已经可以算稳定了(但我不知道是什么原因)
这是600K的结果
-
各位老师,晚上好
我参考了$InterAdsFoam: An Open-Source CFD Model for Granular Media–Adsorption Systems with Dynamic Reaction Zones Subject to Uncontrolled Urban Water Fluxes$和$phaseScalarTransport.C$在compressibleInterFoam中添加了组分方程,个人感觉这个组分方程形式也不是非常复杂,但是在求解过程中会出现局部质量分数增加的情况,如下图所示,想请教一下大家有没有什么建议?volScalarField Deff("Deff",turbulence.muEff()); volScalarField alpharho ( "alpharho", alpha2*rho2 ); surfaceScalarField alphaPhi ( "alphaPhi", linearInterpolate(alpha2*rho2*U) & mesh.Sf() ); fvScalarMatrix alpha2YEqn ( fvm::ddt(alpharho, Yi) + fvm::div(alphaPhi, Yi) - fvm::laplacian ( fvc::interpolate(Deff)*fvc::interpolate(alpha2), Yi ) == fvOptions(alpha2, rho2, Yi) - fvm::ddt(residualAlpha_*rho2, Yi) + fvc::ddt(residualAlpha_*rho2,Yi) ); alpha2YEqn.relax(); fvOptions.constrain(alpha2YEqn); alpha2YEqn.solve(mesh.solver("Yi")); fvOptions.correct(Yi); Yi.max(0.0); //update the results Yi = Yi*alpha2; // should use this guys as Yi Yt += Yi;
O2:
alpha:
T:
U: -
@快乐的山炮 老师,这个求解器的标准案例都是给了
p T U
这些参数
-
@快乐的山炮
老师您好
我是仿照了文献里面的这个模型:
边界条件具体如下,能否麻烦您帮我看一下~(有两个入口(一个液体入口一个气体入口,液体入口所在平面采用的是WALL
,其余采用的是SYMMETRY
))
不知道我对p
和p_rgh
的设置是否准确
alpha.air
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 1; boundaryField { INLET_AIR { type fixedValue; value uniform 1; } INLET_LIQUID { type inletOutlet; inletValue uniform 0; value uniform 0; } OUTLET { type inletOutlet; inletValue uniform 0; value uniform 0; } SYMMETRY { type symmetry; } WALL { type zeroGradient; } }
p
FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 101325; boundaryField { INLET_AIR { type calculated; value uniform 101325; } INLET_LIQUID { type calculated; value uniform 101325; } WALL { type calculated; value uniform 101325; } SYMMETRY { type symmetry; } OUTLET { type waveTransmissive; gamma 1.4; fieldInf 1e+05; lInf 0.0045; value uniform 1e+05; } }
p_rgh
FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 101325; boundaryField { INLET_AIR { type fixedFluxPressure; gradient uniform 0; value uniform 101325; } INLET_LIQUID { type fixedFluxPressure; gradient uniform 0; value uniform 101325; } WALL { type fixedFluxPressure; gradient uniform 0; value uniform 101325; } SYMMETRY { type symmetry; } OUTLET { type totalPressure; p0 uniform 101325; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } }
T
FoamFile { version 2.0; format ascii; class volScalarField; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; internalField uniform 1200; boundaryField { INLET_AIR { type fixedValue; value uniform 1200; } INLET_LIQUID { type fixedValue; value uniform 300; } WALL { type fixedValue; value uniform 300; } SYMMETRY { type symmetry; } OUTLET { type inletOutlet; inletValue uniform 1200; value uniform 1200; } }
U
FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (20 0 0); boundaryField { INLET_AIR { type fixedValue; value uniform (20 0 0); } INLET_LIQUID { type fixedValue; value uniform (0 0 1); } WALL { type noSlip; } SYMMETRY { type symmetry; } OUTLET { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } }
-
@李东岳 好的,李老师 我们整理一下~
-
各位老师下午好,我用compressibleInterFoam计算横射流时总会出现
Negative initial temperature
的报错,这个问题困扰我很久啦,我也看了论坛内和cfd-online上各位老师的回答,但还是没有解决。
主要的尝试有:-
采用可变的时间步长,对Co数进行限制(主要参考文献中的数值)
-
在主程序里面对温度进行限制,但这会导致下图所示非常异常的结果
-
在
constant/fvOptions
中添加limitTemperature
限制 -
修改边界条件(目前p出口采用
waveTransmissive
边界条件,温度和速度出口采用inletOutlet
边界条件)
此外,我对全场的温度最大值和最小值进行了监视,发现温度并不是逐步下降而是在某一迭代过程中骤降,感觉像是没有求解好一样
Time = 0.041271304 MAX::after TEqn_correct.................=max(T) [0 0 0 1 0 0 0] 1317.1702 MIN::after TEqn_correct.................=min(T) [0 0 0 1 0 0 0] 299.99994 Time = 0.041271308 MAX::after TEqn_correct.................=max(T) [0 0 0 1 0 0 0] 2007.9887 MIN::after TEqn_correct.................=min(T) [0 0 0 1 0 0 0] -4652.3157
并且在发散最后输出的时刻,就已经出现了异常的压力和速度(每个发散的case都是这样子,温度全场没有负温):
case1:
case2:
能不能请各位老师给我一点建议,非常感谢!先谢过各位老师了! -
-
@Tens
您好,我参考您的代码也在compressibleInterFoam
中添加了组分方程,目前出现了某种组分的质量分数超过1的情况,这个问题困扰我很久了,可以麻烦您帮我看一下代码有什么问题吗?万分感谢!tmp<fv::convectionScheme<scalar>> mvConvection ( fv::convectionScheme<scalar>::New//convectionScheme:Abstract base class for convection schemes. ( mesh, fields, alpha2rho2phi, mesh.divScheme("div(alpha2rho2phi,Yi)") ) ); { forAll(Y, i) { if (i != inertIndex && composition.active(i)) { volScalarField& Yi = Y[i]; fvScalarMatrix YEqn ( fvm::ddt(alpha2rho2, Yi) + mvConvection->fvmDiv(alpha2rho2phi, Yi) - fvm::laplacian(turbulence.muEff()*alpha2, Yi) == alpha2*parcels.SYi(i, Yi) + fvOptions(rho2, Yi) ); YEqn.relax(); fvOptions.constrain(YEqn); YEqn.solve(mesh.solver("Yi")); fvOptions.correct(Yi); Yi.max(0.0); Yt += Yi; } Y[inertIndex] = scalar(1) - Yt; Info<<"info::inertIndex.................="<< inertIndex <<endl; Info<<"info::Y[inertIndex].................="<< max(Y[inertIndex]) <<endl; Y[inertIndex].max(0.0);
我在
createField.H
中声明了下列变量:volScalarField alpha2rho2 ( IOobject ( "alpha2rho2", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), alpha2*rho2 ); surfaceScalarField alpha2rho2phi ( IOobject ( "alpha2rho2phi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), linearInterpolate(alpha2*rho2*U) & mesh.Sf() );
-
@李东岳 是跑求解器的时候出错的
-
@李东岳 是的 李老师
-
各位老师,我在并行计算时,算到某一时间步就会出现以下报错,想问一下应该如何解决?
Fatal error in MPI_Recv: Message truncated, error stack: MPI_Recv(224)...........................: MPI_Recv(buf=0x7ffcc7ef9140, count=4, MPI_BYTE, src=4, tag=1, MPI_COMM_WORLD, status=0x7ffcc7ef9020) failed MPIDI_CH3_PktHandler_EagerShortSend(455): Message from rank 4 and tag 1 truncated; 8 bytes received but buffer size is 4 srun: Job step aborted: Waiting up to 62 seconds for job step to finish. slurmstepd: error: *** STEP 2055946.0 ON x2510 CANCELLED AT 2023-06-28T15:48:37 *** srun: error: x2510: tasks 0-63: Killed srun: error: y2612: tasks 64-127: Killed
我采用了以下的方法进行网格的划分,不知道会不会有影响(64核和128核我都尝试过了,采用128核可以多算一会,但最后还是会出现
Message truncated, error stack
的报错):numberOfSubdomains 128; method scotch;
-
@wangfei9088
您好,我尝试将其修改为scalar rhoInv = VSMALL
,但还其还是卡在了下面的for
循环当中,不知道您还有什么建议嘛?
输出:celli:516314............. into cellVolMixture into forAll(speciesData_, i) rhoInv:0.71703454 rhoInv:0.71703454 rhoInv:0.71703454 rhoInv:0.71703454 rhoInv:3.4130544 into mixtureVol_ into for(label n=1; n<Y_.size(); n++) celli:516315............. into cellVolMixture into forAll(speciesData_, i) rhoInv:0.71703454 rhoInv:0.71703454 rhoInv:0.71703454 rhoInv:0.71703454 rhoInv:3.4130544 into mixtureVol_ into for(label n=1; n<Y_.size(); n++)
-
@wangfei9088 您是指在
createField.H
中初始化为极小数嘛? -
各位老师,下午好
我目前尝试在compressibleInterFoam添加组分方程,将twoPhaseMixture类做了以下修改:thermo1_ = rhoThermo::New(U.mesh(), phase1Name()); thermo2_ = rhoReactionThermo::New(U.mesh(), phase2Name());
只修改
thermo2
的原因是假设液相为单组分系统,气相为多组分系统。
目前编译正常通过,在运行算例时会遇到下面的问题:#0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in /lib/x86_64-linux-gnu/libpthread.so.0 #3 Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::patchFaceVolMixture(double, double, int, int) const at ??:? #4 Foam::heRhoThermo<Foam::rhoReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::calculate(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, bool) at ??:? #5 Foam::rhoReactionThermo::addfvMeshConstructorToTable<Foam::heRhoThermo<Foam::rhoReactionThermo, Foam::SpecieMixture<Foam::singleStepReactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > > > >::New(Foam::fvMesh const&, Foam::word const&) at ??:? #6 Foam::autoPtr<Foam::rhoReactionThermo> Foam::basicThermo::New<Foam::rhoReactionThermo>(Foam::fvMesh const&, Foam::word const&) at ??:? #7 Foam::rhoReactionThermo::New(Foam::fvMesh const&, Foam::word const&) at ??:? #8 Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:? #9 ? in ~/OpenFOAM/dyfluid-v2012/platforms/linux64GccDPInt32Opt/bin/atomizationFoam #10 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 #11 ? in ~/OpenFOAM/dyfluid-v2012/platforms/linux64GccDPInt32Opt/bin/atomizationFoam Floating point exception (core dumped)
我通过逐行插入输出语句发现运行卡顿在下面这一句:
Info<<" twoPhaseMixtureThermo::debug2222222"<<endl; thermo1_ = rhoThermo::New(U.mesh(), phase1Name()); thermo2_ = rhoReactionThermo::New(U.mesh(), phase2Name()); Info<<" twoPhaseMixtureThermo::debug3333333"<<endl;
输出如下:
debug0000000 Constructing twoPhaseMixtureThermo Selecting surfaceTensionModel constant twoPhaseMixtureThermo::debug00000000 phase1Name:water twoPhaseMixtureThermo::debug111111111 phase2Name:air twoPhaseMixtureThermo::debug2222222 use rhoThermo::New->basicThermo::New into basicThermo::New into lookupThermo actually into lookupThermo Selecting thermodynamics package { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState rhoConst; specie specie; energy sensibleEnthalpy; } debug::into rhoReactionThermo1111111111 into basicThermo::New into lookupThermo actually into lookupThermo Selecting thermodynamics package { type heRhoThermo; mixture singleStepReactingMixture; transport sutherland; thermo janaf; energy sensibleEnthalpy; equationOfState perfectGas; specie specie; } Selecting chemistryReader foamChemistryReader chemistryReader::debug111111111 foamChemistryReader::debug22222222222 foamChemistryReader::debug22222222222 foamChemistryReader::debug22222222222 foamChemistryReader::debug22222222222 foamChemistryReader::debug22222222222 Fuel heat of combustion :46447948 stoichiometric air-fuel ratio :15.602043 stoichiometric oxygen-fuel ratio :3.635401 Maximum products mass concentrations: H2O: 0.098613587 CO2: 0.18067909 N2: 0.72070733
而后再对
multiComponentMixture
进行逐行输出,发现卡顿在下面这段循环语句:
想问一下,有没有老师遇到过类似的情况,或者出现这个错误可能出现的原因?
此外,液体入口处是通过snapyyHexMesh
生成的,如图所示,这会不会也对case的运行有影响呢?
-
好的,李老师,我在回去多调试一下
-
@李东岳 李老师,是自己尝试耦合了compressibleInterFoam和sprayFoam求解器(可能还有一些问题),对于这个问题您有什么建议嘛~
-
各位老师晚上好,在运行算例时出现了以下的报错信息:
--> FOAM FATAL ERROR: (openfoam-2012 patch=220610) Negative initial temperature T0: -799.34782
之前算例出现
Negative initial temperature
时,确实由于我场内出现了负温,但这个case我监测过全场的温度,并且在paraview中rescale了温度,并未出现负温(下图是我的温度云图),想请教一下各位老师可能是什么问题导致的?
-
@李东岳 李老师
输出Heat_Capacity[volID]
的结果是:Heat Capacity[volID]:9.0420861e-12
,这个值异常的小,我后面对这个变量进行累加并加权平均,这导致我液滴的Cp
几乎为零,这或许是我segmentation fault的原因? -
各位老师晚上好~
我自定义求解器编译成功,在运行算例的时候,读取我自定义phaseCoupling.H文件,会出现segmentation fault。其中这个文件是参照之前文章提供的求解器,我只进行了小部分修改。通过逐行输出,可以发现问题主要出现在Heat_Capacity[volID] += alpha_[cellI]*mesh_.V()[cellI]*Cp_[cellI];
这一句。
可以麻烦有经验的老师帮我看一下可能的错误嘛~
phaseCoupling.HforAll(mesh_.cells(), cellI) { if (vofID_[cellI] > 0.1) { Info << " debug6 " << endl; // Get volume ID label volID = floor(vofID_[cellI] + 0.5); Info << " debug7 " << endl; noCells[volID] += 1; Info << " debug8 " << endl; cellVolume[volID] += mesh_.V()[cellI]; Info << " debug9 " << endl; volume[volID] += alpha_[cellI]*mesh_.V()[cellI]; Info << " debug10 " << endl; velocity[volID] += alpha_[cellI]*mesh_.V()[cellI]*U_[cellI]; Info << " debug11 " << endl; position[volID] += alpha_[cellI]*mesh_.V()[cellI]*mesh_.C()[cellI]; Info << " debug12 " << endl; Temperature[volID] += alpha_[cellI]*mesh_.V()[cellI]*T_[cellI]; Info << " debug13 " << endl; Heat_Capacity[volID] += alpha_[cellI]*mesh_.V()[cellI]*Cp_[cellI]; Info << " debug14 " << endl; Density[volID] += alpha_[cellI]*mesh_.V()[cellI]*density_[cellI]; } }
报错信息:
debug1 debug2 debug3 debug4 debug5 debug6 debug7 debug8 debug9 debug10 debug11 debug12 debug13 #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 ? in /lib/x86_64-linux-gnu/libpthread.so.0 #3 Foam::phaseCoupling::update() at ??:? #4 ? in ~/OpenFOAM/dyfluid-v2012/platforms/linux64GccDPInt32Opt/bin/mycompressible #5 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 #6 ? in ~/OpenFOAM/dyfluid-v2012/platforms/linux64GccDPInt32Opt/bin/mycompressible Segmentation fault (core dumped)
-
@李东岳 请问李老师,这里添加的A,k0,k需要去哪里声名或者定义呢,是在求解器的C文件当中吗?
-
请教各位老师,参考了相关文献,我想在动量方程中添加如下的湍流激励项(方程最右边):
其中A为湍流forcing参数,k为瞬时计算的湍流动能,k0为期望的稳态湍流动能。请问这里需要怎么添加代码? -
@Miss-Zhou_DUT 您好,请问您解决这个问题了嘛
-
各位老师晚上好,在看sprayFoam代码的过程中,发现其在YEqn.H中定义了一个mvConvection变量
tmp<fv::convectionScheme<scalar>> mvConvection ( fv::convectionScheme<scalar>::New ( mesh, fields, phi, mesh.divScheme("div(phi,Yi_h)") ) );
并通过
mvConvection->fvmDiv(phi, Yi)
来表示对流项,想问一下他与fvm::div
的区别在哪里呢?以及fv::convectionScheme<scalar>::New
中的各个量有什么意义呢? -
您好,请问一下您实现在compressibleInterFoam中添加组分方程了嘛
-
@Rachel0096 接口部分内容如下:
-
请问一下各位前辈,我尝试在原本查小火焰表更新源项的位置,更换为神经网络推理计算,编译成功了但是在更新项时出现了以下报错,不知道是哪里出现了问题。应该是在建立tensor的时候就报错了。
-
@chengan-wang
您好,想问一下,你知道如何根据openfoam中的内能守恒方程,推导得到compressibleInterFoam中的能量方程嘛?知乎上面说是乘以alpha/Cv,但我自己推导有点问题
div(rhoPhi, T)和div(Phi,T)有什么不一样呢? fvc::div(fvc::absolute(phi, U), p)这一项中absolute是什么意思呢
-
@Tens 是的,是在别人求解器的基础上改的,对于这个问题,您有什么建议嘛
-
大家中午好,我在超算上面64核运行一个算例,中途终止了,再续算就会出现这样的问题。我试过如果不中止算例,是可以一直算下去的,非常困惑,不知道这是什么原因,有大佬遇到过类似的问题吗 -
@OItoCFD 请问是加在哪里啊,是要写一个后处理文件嘛
-
请教一下大家,如图想统计不同流向位置切片处的拉格朗日点的数量,应该怎么统计呢?
我在paravie中采用slice命令,显示不出粒子,应该采用什么命令呢 -
好的好的,我去试试,谢谢李老师
-
@Rachel0096 省流版就是 IBM他等不及了
-
@李东岳 李老师,我上个周刚刚被我导师换课题了,现在做横射流雾化 因为后期想要做到燃烧,所以需要改到可压缩的求解器里面
-
各位老师,晚上好。
我根据一个interIsoFoam的case,想把他按照原来的工况在compressibleInterIsoFoam中重新跑一下,主要是模拟横射流的,示意图如下图所示,但是出现以下问题:
其中,p_rgh、U和alpha.water都是之前interIsoFoam的设置
0/p:dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { INLET_AIR { type fixedFluxPressure; value uniform 0; } INLET_LIQUID { type fixedFluxPressure; value uniform 0; } WALL { type fixedFluxPressure; value uniform 0; } SYMMETRY { type symmetry; } OUTLET { type totalPressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } }
0/alpha.water
dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { INLET_AIR { type inletOutlet; inletValue uniform 0; value uniform 0; } INLET_LIQUID { type fixedValue; value uniform 1; } OUTLET { type zeroGradient; } SYMMETRY { type symmetry; } WALL { type zeroGradient; } }
0/U
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { INLET_AIR { type fixedValue; value uniform (10 0 0); } INLET_LIQUID { type fixedValue; value uniform (0 0 1); } WALL { type noSlip; } SYMMETRY { type symmetry; } OUTLET { type inletOutlet; inletValue uniform (0 0 0); value uniform (0 0 0); } } // ************************************************************************* //
我自己主要添加了p、T、thermophysicalProperties.air和thermophysicalProperties.water文件,主要设置如下
pdimensions [1 -1 -2 0 0 0 0]; internalField uniform 101325; boundaryField { INLET_AIR { type calculated; value $internalField; } INLET_LIQUID { type calculated; value $internalField; } WALL { type calculated; value $internalField; } SYMMETRY { type symmetry; } OUTLET { type inletOutlet; inletValue uniform 0; value uniform 0; } }
T
dimensions [0 0 0 1 0 0 0]; internalField uniform 300; boundaryField { INLET_AIR { type fixedValue; value uniform 300; } INLET_LIQUID { type fixedValue; value uniform 300; } WALL { type zeroGradient; } SYMMETRY { type symmetry; } OUTLET { type inletOutlet; inletValue uniform 300; value uniform 300; } }
thermophysicalProperties.water
thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState rhoConst;//认为其不可压缩,或许采用perfectfluid也可以? specie specie; energy sensibleInternalEnergy; } mixture { specie { molWeight 18.0; } equationOfState { rho 1000; } thermodynamics { Cp 4195; Hf 0; } transport { mu 1e-3; Pr 7; } }
thermophysicalProperties.air
thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleInternalEnergy; } mixture { specie { molWeight 28.9; } thermodynamics { Cp 1013; Hf 0; } transport { mu 16.337e-06; Pr 0.7; } }
想问一下我的这些设置是否存在不合理的地方,当出现报错的时候,有没有什么方法可以找到出错的原因(我每次总是百度+论坛),怎么能够查看自己的边界条件是否合理呢,以及在thermophysicalProperties中的Pmin应该根据什么来进行设置?
问题有点多,麻烦各位老师啦! -
在验证质量守恒,计算域内的质量可以求出,想请教一下,出口液相的质量应该怎么计算呢
编译求解器的时候出现undedined reference错误
编译求解器的时候出现undedined reference错误
mapField报错
mapField报错
sprayFoam报错
sprayFoam报错
运行结束后输出密度rho
运行结束后输出密度rho
OpenFOAM中decomposePar分区时,网格是如何分配的?
compressibleInterFoam 耦合多组分传输模型
VOF方法给气相添加组分方程,液相部分存在组分,怎么解决
compressibleInterFoam 耦合多组分传输模型
reactingTwoPhaseEulerFoam可以做液体横射流雾化燃烧嘛?
mvConvection->fvmDiv
类sprayFoam求解器 求解冷态流场时错误
compressibleInterFoam出现Negative initial temperature
组分输运方程求解异常
compressibleInterFoam出现Negative initial temperature
compressibleInterFoam出现Negative initial temperature
compressibleInterFoam出现Negative initial temperature
compressibleInterFoam出现Negative initial temperature
从0开始计算没问题,停掉再续算过几步就出错
并行计算报错Fatal error in MPI_Recv: Message truncated, error stack
并行计算报错Fatal error in MPI_Recv: Message truncated, error stack
并行计算报错Fatal error in MPI_Recv: Message truncated, error stack
twoPhaseMixture类修改,编译通过,运行出错
twoPhaseMixture类修改,编译通过,运行出错
twoPhaseMixture类修改,编译通过,运行出错
出现Negative initial temperature,但全场并未出现负温
出现Negative initial temperature,但全场并未出现负温
出现Negative initial temperature,但全场并未出现负温
运行算例出现segmentation fault
运行算例出现segmentation fault
openfoam中添加湍流激励
openfoam中添加湍流激励
twoPhaseMixture类中添加muf()函数报错求助
mvConvection->fvmDiv
关于在compressibleInterFoam中添加组分方程
尝试加入神经网络推理,编译成功运行报错
尝试加入神经网络推理,编译成功运行报错
compressibleInterFoam能量方程疑惑
超算续算报错
超算续算报错
如何对拉格朗日粒子进行统计?
如何对拉格朗日粒子进行统计?
CompressibleInterIsoFoam边界条件设定
CompressibleInterIsoFoam边界条件设定
CompressibleInterIsoFoam边界条件设定
CompressibleInterIsoFoam边界条件设定
interFoam求解器统计出口液相的质量