各位大佬,请教一个时间步长的问题
一般来说,时间步长越小,计算的精度越高,相应的计算资源消耗也越大。
有没有遇到时间步长过小时(比如1.0e-07,带化学反应),流场就“静止”了,组分浓度不再变化。但是时间步长又不能调大,容易发散。
请各位大佬解惑。
书生kao
帖子
-
时间步长对计算结果的影响 -
气固颗粒反应组分输运方程问题计算气固颗粒反应流动,稠密颗粒流动的基础上添加了气固反应,组分输运方程的代码如下:
{ combustion->correct(); Qdot = combustion->Qdot(); volScalarField Yt(0.0*Y[0]); const volScalarField muEff(turbulence->muEff()); forAll(Y, i) { if (i != inertIndex && composition.active(i)) { volScalarField& Yi = Y[i]; fvScalarMatrix YiEqn ( fvm::ddt(alphac, rhoc, Yi) + mvConvection->fvmDiv(alphaRhoPhic, Yi) - fvm::laplacian ( fvc::interpolate(alphac) *fvc::interpolate(muEff), Yi ) == vanadiumParcels.SYi(i, Yi) + combustion->R(Yi) + fvOptions(rhoc, Yi) ); YiEqn.relax(); fvOptions.constrain(YiEqn); YiEqn.solve("Yi"); fvOptions.correct(Yi); Yi.max(0.0); Yt += Yi; } } Y[inertIndex] = scalar(1) - Yt; Y[inertIndex].max(0.0); }
编译是没有问题的,目前遇到的问题是各组分的质量分数不对。
反应是生成Cl2,消耗O2,inertSpecie为N2,计算过程氯气的质量分数不断增加(未越界),而N2的质量分数减少。实际上即便完全反应,N2的质量分数下降应该不大,计算结果不符合实际现象。
个人理解问题应该是vanadiumParcels.SYi(i, Yi)
,可以理解为组分输运方程的源项,其代码为template<class CloudType> inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi ( const label i, volScalarField& Yi ) const { if (this->solution().coupled()) { if (this->solution().semiImplicit("Yi")) { tmp<volScalarField> trhoTrans ( volScalarField::New ( this->name() + ":rhoTrans", this->mesh(), dimensionedScalar(dimMass/dimTime/dimVolume, 0) ) ); volScalarField& sourceField = trhoTrans.ref(); sourceField.primitiveFieldRef() = rhoTrans_[i]/(this->db().time().deltaTValue()*this->mesh().V()); const dimensionedScalar Yismall("Yismall", dimless, small); return fvm::Sp(neg(sourceField)*sourceField/(Yi + Yismall), Yi) + pos0(sourceField)*sourceField; } else { tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(Yi, dimMass/dimTime)); fvScalarMatrix& fvm = tfvm.ref(); fvm.source() = -rhoTrans_[i]/this->db().time().deltaTValue(); return tfvm; } } return tmp<fvScalarMatrix>(new fvScalarMatrix(Yi, dimMass/dimTime)); }
到目前为止,我也没看出来有啥问题。所以,想请教一下吧里的大佬,能否帮我解答一下疑惑?如何解决这个问题,请各位大佬不吝赐教!!!
-
DPMFoam和twoPhaseEulerFoam颗粒流化@李东岳 @星星星星晴 @zhouxu
各位大佬,问题基本解决了,需要关闭kineticCloudProperties中的cellValueSourceCorrection选项。
我在之前气固反应模型添加过程中借鉴了reactingParcelFoam和coalChemistryFoam的内容,计算中开启了cellValueSourceCorrection选项,其计算过程为template<class ParcelType> template<class TrackCloudType> void Foam::KinematicParcel<ParcelType>::cellValueSourceCorrection ( TrackCloudType& cloud, trackingData& td, const scalar dt ) { td.Uc() += cloud.UTrans()[this->cell()]/massCell(td); }
我在网上找了一个解答链接文本https://bugs.openfoam.org/view.php?id=2199
2. Normally during the particle iteration the continuous phase properties are frozen and the momentum sources from particles are applied to the next fluid solution. If cellValueSourceCorrection is true, the continuous phase properties are modified already after each particle time-step to roughly take into account the coupling from the particles to the fluid. This can be sometimes beneficial, but it can also cause numerical problems as there is no under-relaxation applied.
供各位参考。 -
DPMFoam和twoPhaseEulerFoam颗粒流化@星星星星晴
提高气流速度、减小颗粒密度是可以实现流化的,但是和实验不一致了。
原本目的是在DPMFoam基础上增加气固反应过程,和实验结果进行对比,但是计算中发现改进的DPMFoam吹不动颗粒,这才回过头来考察DPMFoam本身的问题,发现确实是和双流体计算差别较大。仔细检查方程好像又没有什么问题,修改了曳力模型也没有效果。
有遇到相关问题的大佬吗,帮忙解答一下。 -
DPMFoam和twoPhaseEulerFoam颗粒流化各位大佬,求助有关颗粒流态化的两个求解器的对比。
先描述一下计算过程:二维流化床,10mmx1000mm,来流速度为0.4m/s,气相密度0.446kg/m3,粘性系数0.0000412Pa·s,颗粒相密度4000kg/m3,直径0.5mm,曳力模型采用WenYu。
遇到的问题是采用twoPhaseEulerFoam时颗粒是可以流化的,而采用DPMFoam时颗粒基本不动,如图所示。
初步怀疑是lagrangian方法的曳力求解有问题,但是仔细看了代码,又按照自己的逻辑写了一遍,DPMFoam求解颗粒还是不动。
请问各位大佬,有遇到这种问题的吗?有解决方案吗?非常感谢! -
求助帖:OpenFOAM后处理极小数感谢大佬们提的建议,用python解决了,感觉后处理用python很方便!
-
求助帖:OpenFOAM后处理极小数OpenFOAM后处理怎么处理非常小的数,量级10^-10,导入paraview中就被截断了,我猜应该是paraview的问题 ,应该怎么导入这类数据呢
比方说化学反应的,如图,导入paraview中截断为0.7了,我需要小数点后10位的数值。
-
如何在coalChemistryFoam中加入pairCollision模型?改写了coalChemistryFoam求解器,添加了volume fraction。现在想把pairCollision模型也添加到coalChemistryFoam中,有些一筹莫展,请求大神指点!!!
目前想到2个思路,一是把CollidingParcel加入到coalParcel中,已经试过了,有问题,应该不可行吧;二是改写pairCollision模型,现在卡壳了,不知道该怎么改。 -
reactingParcelFoam中颗粒间碰撞参数此帖终结!!!此帖终结!!!此帖终结!!!
想得有点简单了,coalChemistryFoam和DPMFoam求解的方程有差别,coalChemistryFoam是two-way coupling,DPMFoam是four-way coupling,cfd-online论坛上有人讲了这个问题,简单的添加CollidingCloud是行不通的。
感谢!!!粘帖原文
“Dear cmigueis,
Thank you for your quick reply.
First of all, I mean that your work can model reacting dilute two-phase flow, but not reacting dense two-phase flow. We can see in DPMFoam solver, there is an “alphac” in the mass and momentum equations of Ueqn.H, which mean the void fraction (voidage). However, in coalChemistryFoam, there isn’t a void fraction. That is, even though you implement coal cloud collisions into coalChemitryFoam, it look like DPM model in ANSYS Fluent, but not a CFD-DEM model with reaction, you should also implement “alphac”(voidage) into mass, momentum and energy equations.
For more details, you can have a look at article “Ku X, Li T, Løvås T. CFD–DEM simulation of biomass gasification with steam in a fluidized bed reactor [J]. Chemical Engineering Science, 2015, 122: 270-283.” or “Zhou H, Flamant G, Gauthier D. DEM-LES simulation of coal combustion in a bubbling fluidized bed Part II: coal combustion at the particle level [J]. Chemical Engineering Science, 2004, 59(20): 4205-4215.”, in these work, four-way coupling CFD-DEM with reaction were adopted to simulate a fluidized bed. The former is accomplished on OpenFOAM framework.
In my opinion, if you want to model dense phase reacting flow like above literature, I think DPMFoam combined with coalChemistryFoam can achieve it, which is the work I want to do and I am doing. Generally speaking, DPMFoam has already had parcels collisions and it is CFD-DEM method which can be used in cold fluidized bed modeling. If you only model pulverized coal combustion (that is, reacting dilute two-phase flow), four-way coupling is not necessary.
Best regards! ” -
reactingParcelFoam中颗粒间碰撞参数错误信息:
sigma@ma:lib$ ld libcoalDepositionDemo.so ld: warning: cannot find entry symbol _start; not setting start address ld: libcoalDepositionDemo.so: undefined reference to `Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > >::typeName' ld: libcoalDepositionDemo.so: undefined reference to `Foam::ParticleForce<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > >::debug' ld: libcoalDepositionDemo.so: undefined reference to `Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > >::typeName' ld: libcoalDepositionDemo.so: undefined reference to `Foam::SurfaceReactionModel<Foam::ReactingMultiphaseCloud<Foam::ReactingCloud<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::PhaseChangeModel<Foam::ReactingCloud<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > >::typeName' ld: libcoalDepositionDemo.so: undefined reference to `Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > >::debug' ld: libcoalDepositionDemo.so: undefined reference to `Foam::DispersionModel<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > >::debug' ld: libcoalDepositionDemo.so: undefined reference to `Foam::StochasticCollisionModel<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::SurfaceReactionModel<Foam::ReactingMultiphaseCloud<Foam::ReactingCloud<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > > > >::typeName' ld: libcoalDepositionDemo.so: undefined reference to `Foam::InjectionModel<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::CloudFunctionObject<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::typeName' ld: libcoalDepositionDemo.so: undefined reference to `Foam::CompositionModel<Foam::ReactingCloud<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::SurfaceReactionModel<Foam::ReactingMultiphaseCloud<Foam::ReactingCloud<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > > > >::constructdictionaryConstructorTables()' ld: libcoalDepositionDemo.so: undefined reference to `Foam::SurfaceFilmModel<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::CloudFunctionObject<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::ParticleForce<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::typeName' ld: libcoalDepositionDemo.so: undefined reference to `Foam::SurfaceReactionModel<Foam::ReactingMultiphaseCloud<Foam::ReactingCloud<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > > > >::destroydictionaryConstructorTables()' ld: libcoalDepositionDemo.so: undefined reference to `Foam::PatchInteractionModel<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::DevolatilisationModel<Foam::ReactingMultiphaseCloud<Foam::ReactingCloud<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::HeatTransferModel<Foam::ThermoCloud<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > > >::dictionaryConstructorTablePtr_' ld: libcoalDepositionDemo.so: undefined reference to `Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > >::typeName' ld: libcoalDepositionDemo.so: undefined reference to `Foam::CollisionModel<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > >::dictionaryConstructorTablePtr_'
-
reactingParcelFoam中颗粒间碰撞参数开门见山,问3个问题:
第一个问题1、在reactingParcelFoam或coalChemistryFoam中颗粒间的碰撞参数在哪修改?计算过程颗粒间碰撞回弹的感觉不大对。
第二个问题2、能否在coalCloud.H中修改为这样,添加CollidingCloud,同样在coalParcel.H中添加CollidingParcel?尝试后编译库文件通过,但是编译coalChemistryFoam失败。#ifndef coalCloud_H #define coalCloud_H #include "Cloud.H" #include "KinematicCloud.H" #include "CollidingCloud.H" #include "ThermoCloud.H" #include "ReactingCloud.H" #include "ReactingMultiphaseCloud.H" #include "coalParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef ReactingMultiphaseCloud < ReactingCloud < ThermoCloud < CollidingCloud < KinematicCloud < Cloud < coalParcel > > > > > > coalCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif
第三个问题3、patchInteractionModel和collisionModel中的wallModel(如模型wallSpringSliderDashpot)有什么区别?
OpenFOAM用的还不熟,目前想在reactingParcelFoam中加入表面反应模型,模拟沉积CVD过程。计算的喷动床,感觉颗粒间的碰撞过程不大对,请高手指点!!!非常感谢,感谢!!!!!!
-
一套鼠标控制多个电脑的软件,MARK下载试试。
-
传热计算中物性参数分段线性插值问题@cccrrryyy 对的,fluent是可以查表什么的,fluent用得很熟练,现在刚转到openfoam上,感觉应该是可以建个表,但是openfoam还没那么熟练,还得多练习,现在先找个成熟的方法做一下。
-
传热计算中物性参数分段线性插值问题好久没混圈里了,最近由fluent转到openfoam,用的不熟练,菜菜鸟。
请教大佬们一些问题,传热计算中像煤油、CO2这类介质的热物性如何加到计算里,现在有实验数据,每个温度对应一个cp、nu、k,fluent中是可以用piecewise-linear拟合的,openfoam中有没有这种写法?
我搜了一下帖子,有大佬在弄多段拟合,好像也有一些奇怪的问题。 -
有人能从美国亚马逊带三本CFD书么?@东岳 朋友3.25回国吧,需要的话我可以帮你联系一下他
-
有人能从美国亚马逊带三本CFD书么?倒是有同学4月份回国,时间要晚上两个多月。
-
FLUENT ERROR并行计算的问题,一般是计算过程出错就会出现这些error文件。
删掉没啥影响,重新打开并行计算就可以了。 -
大涡模拟LES有各项同性假设吗?可以参考一下张兆顺的《湍流大涡数值模拟的理论与应用》这本书,讲得还是比较清楚的。
先给你截个图,“高雷诺数湍流的局部各向同性是大涡模拟的主要理论依据,也是构造一切亚格子模型的基础。”
-
Fluent瞬态计算结果完成后,如何提取某点流动参数?看你需要的物理量,电脑内存大小吧,也可以把虚拟内存设置的大一点。
倒是可以提供你一个方法,用fluent的transient export方法把需要的物理量批量导出来,再读入到tecplot中,大概可以减少一下内存消耗。
当然了最可行的还是给电脑加内存条,整大一点(~128GB),处理啥都不是问题。 -
有关Fluent材料库面板中焓值的单位1 kgmol = 1000 mol,换算一下就行了。