@李东岳 李老师,该问题已经解决,是由于部分的options文件多了这一行,导致编译的时候标准不同了。
但是在调试算例的时候又出现了如下问题,应该是src中lagrangian有一部分存在问题,但是目前我没找到具体的问题出在哪,不知道是不是版本不同编译导致的?
Rachel0096
帖子
-
编译求解器的时候出现undedined reference错误 -
编译求解器的时候出现undedined reference错误各位老师,我想请教在编译求解器的时候出现如下错误应该如何解决:
* -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文件:
-
mapField报错自问自答一下,可以参考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🌟可以解决我遇到的这个报错
-
mapField报错各位老师,我要计算一个比较大的网格,大概是九千万左右的网格数,一开始设置了一个比较粗的网格,计算了一段时间以后想要映射到这个细网格上面,但是在超算上面映射会报错,想问一下各位老师知道是什么原因吗?
我用的命令是:mapFields ../JICF -consistent
还有相请教一下mapFields如何多核并行映射呢,采用-parallel
会显示没有这个option
(现在真的太慢了) -
sprayFoam报错我的
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报错请教一下,我用sprayFoam求解器跑了一晚上之后报了这个错是什么原因呀?:134
-
运行结束后输出密度rho@李东岳 老师你好,是可压缩的算例,我在计算的后期修改求解器的代码输出了rho,现在想通过后处理手段补上前期时刻的rho
-
运行结束后输出密度rho我是个openfoam新手,请教一下各位老师:
我的算例计算时没有输出密度rho,在计算结束后,还有办法输出吗?
-
OpenFOAM中decomposePar分区时,网格是如何分配的?采用“method simple”分区时,每个核分到的网格,是怎么确定的?
我在处理一个很大的算例(三亿网格),用reconstructPar合并数据太慢了,我想直接对每个processor*文件夹中的数据处理,必要时可以自己用编程语言合并场(数组的变形和拼接)。
我用简单的算例测试了一下,还是没有搞清楚,“method simple”给每个核分配网格的方法,在此请教一下各位老师和同学、同僚。
-
compressibleInterFoam 耦合多组分传输模型不知道各位老师有没有看过米兰理工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; }
-
VOF方法给气相添加组分方程,液相部分存在组分,怎么解决@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
-
compressibleInterFoam 耦合多组分传输模型@Zhong-combustion 您好,请问您实现这个功能了嘛,可以交流一下吗~
-
reactingTwoPhaseEulerFoam可以做液体横射流雾化燃烧嘛?各位老师,之前用的是
compressibleInterFoam
求解器来计算横射流雾化,后面以期做到燃烧,但由于水平有限,在添加组分方程时便遇到许多问题。
现在发现reactingTwoPhaseEulerFoam
,其本身就有YEqns.H
,并且据我现在初步了解他可以通过选定reactingPhaseModel
相模型来计算反应。This model represents a phase with multiple species and volumetric reactions.
想问一下如果用
reactingTwoPhaseEulerFoam
可以做液体横射流雾化燃烧嘛? -
mvConvection->fvmDiv@李东岳 李老师您好
我参考的组分方程中的扩散项采取了以下的形式:// 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求解器 求解冷态流场时错误目前想用一个类似sprayFoam的求解器,算一个旋流燃烧的算例。在喷入燃料前需要先通入空气,对冷态流场进行计算。但在冷态流场计算时,出现了部分高温、高压的小块出现,同时时间步变的很慢,无法继续正常计算,不知道各位有没有什么建议和指导
右边绿色区块为inlet,流入空气,仅有流向速度为20m/s(后方圆柱长度约为20mm)。紫色平面包括叶片为wall。
截取了某时间点的温度分布,出现明显高温小块(同时高压),且后续会持续上涨,无法正常计算。 -
compressibleInterFoam出现Negative initial temperature@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: -
compressibleInterFoam出现Negative initial temperature@快乐的山炮 老师,这个求解器的标准案例都是给了
p T U
这些参数
-
compressibleInterFoam出现Negative initial temperature@快乐的山炮
老师您好
我是仿照了文献里面的这个模型:
边界条件具体如下,能否麻烦您帮我看一下~(有两个入口(一个液体入口一个气体入口,液体入口所在平面采用的是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@李东岳 好的,李老师 我们整理一下~