@jxzs_zy 在开发,好像还没正式发布。Added dynamicPolyRefinementFvMesh
尚善若水
帖子
-
-
已解决。
-
试下 writeControl adjustableRunTime;
-
controlDict 可以贴一下吗?看下哪里的问题
-
大家好,最近写大论文在做一些求解器验证,如下所示。我想设置第三张图中的的 Shu-Osher 的边界(内部场)条件,请问:如何布置密度之类的正弦内部场?
-
一个建议:用 pvpython 读取数据,求差,再 matplotlib 出图
-
破案了。程序没问题,是我自定义的用于AMR的coded量忘记clear了
-
@尚善若水 仔细看了下代码,应该是这里的问题,在网格变化后需要clear,如图二。我想直接使用reactingfoam的代码好像不行,这就是在AMR时出错的原因。但是怎么改呢?
-
@csj1246957849 这是你在fvSchemes中使用了backward的ddt格式吧?
-
@李东岳 是的李老师,我也不太精通of。尤其是改为了模块化之后,没检查出来问题。
-
大家好,最近做了一个工作,把 of-dev 的 AMR 扩展到了二维和一维。官方的求解器可以良好运行,但是我根据 shockFluid 模块化求解器,即原 rhoCentralFoam,开发的可压缩反应流求解器 shockMulticomponentFluid 在 AMR 之后会报错,没有 AMR 正常运行。
PS:shockFluid 单独测试,二维 AMR 没问题,所以我猜测可能是化学反应求解功能添加的有问题,但是非 AMR 情况下又可以运行。
日志如下,请指教。
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for Ux, Initial residual = 0.999796, Final residual = 2.56202e-11, No Iterations 4 smoothSolver: Solving for Uy, Initial residual = 0.999887, Final residual = 9.91964e-12, No Iterations 4 [1] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [1] #1 Foam::sigFpe::sigHandler(int) at ??:? [1] #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" [1] #3 Foam::seulex::seul(double, Foam::Field<double> const&, int, double, int, Foam::Field<double>&, Foam::Field<double> const&) const at ??:? [1] #4 Foam::seulex::solve(double&, Foam::Field<double>&, int, Foam::ODESolver::stepState&) const[0] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [1] #5 Foam::ODESolver::solve(double, double, Foam::Field<double>&, int, double&) const at ??:? [1] #6 Foam::ode<Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::solve(double&, double&, Foam::Field<double>&, int, double&, double&) const[2] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [0] #1 Foam::sigFpe::sigHandler(int)[3] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [2] #1 Foam::sigFpe::sigHandler(int) at ??:? [1] #7 double Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve<Foam::UniformField<double> >(Foam::UniformField<double> const&) at ??:? [0] #2 ? at ??:? [3] #1 Foam::sigFpe::sigHandler(int) in "/lib/x86_64-linux-gnu/libc.so.6" [0] #3 Foam::seulex::seul(double, Foam::Field<double> const&, int, double, int, Foam::Field<double>&, Foam::Field<double> const&) const at ??:? [2] #2 ? at ??:? [1] #8 Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve(double) at ??:? [0] #4 Foam::seulex::solve(double&, Foam::Field<double>&, int, Foam::ODESolver::stepState&) const in "/lib/x86_64-linux-gnu/libc.so.6" [2] #3 Foam::seulex::seul(double, Foam::Field<double> const&, int, double, int, Foam::Field<double>&, Foam::Field<double> const&) const at ??:? [3] #2 ? at ??:? [0] #5 Foam::ODESolver::solve(double, double, Foam::Field<double>&, int, double&) const at ??:? [2] #4 Foam::seulex::solve(double&, Foam::Field<double>&, int, Foam::ODESolver::stepState&) const at ??:? [1] #9 Foam::combustionModels::laminar::correct() in "/lib/x86_64-linux-gnu/libc.so.6" [3] #3 Foam::seulex::seul(double, Foam::Field<double> const&, int, double, int, Foam::Field<double>&, Foam::Field<double> const&) const at ??:? [0] #6 Foam::ode<Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::solve(double&, double&, Foam::Field<double>&, int, double&, double&) const at ??:? [2] #5 Foam::ODESolver::solve(double, double, Foam::Field<double>&, int, double&) const at ??:? [3] #4 Foam::seulex::solve(double&, Foam::Field<double>&, int, Foam::ODESolver::stepState&) const at ??:? [1] #10 Foam::solvers::shockMulticomponentFluid::compositionPredictor() at ??:? at ??:? [3] #5 Foam::ODESolver::solve(double, double, Foam::Field<double>&, int, double&) const[2] #6 Foam::ode<Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::solve(double&, double&, Foam::Field<double>&, int, double&, double&) const at ??:? [0] #7 double Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve<Foam::UniformField<double> >(Foam::UniformField<double> const&) at ??:? [1] #11 Foam::solvers::shockMulticomponentFluid::thermophysicalPredictor() at ??:? [3] #6 Foam::ode<Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::solve(double&, double&, Foam::Field<double>&, int, double&, double&) const at ??:? [1] #12 at ??:? [0] #8 Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve(double) at ??:? [2] #7 double Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve<Foam::UniformField<double> >(Foam::UniformField<double> const&)? at ??:? [3] #7 double Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve<Foam::UniformField<double> >(Foam::UniformField<double> const&) in "/home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/foamRun" [1] #13 ? at ??:? [0] #9 Foam::combustionModels::laminar::correct() in "/lib/x86_64-linux-gnu/libc.so.6" [1] #14 __libc_start_main at ??:? [2] #8 Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve(double) in "/lib/x86_64-linux-gnu/libc.so.6" [1] #15 at ??:? [0] #10 Foam::solvers::shockMulticomponentFluid::compositionPredictor() at ??:? [3] #8 Foam::chemistryModel<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > >::solve(double)? at ??:? [0] #11 Foam::solvers::shockMulticomponentFluid::thermophysicalPredictor() in "/home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/foamRun" [scramjetFoam:688967] *** Process received signal *** [scramjetFoam:688967] Signal: Floating point exception (8) [scramjetFoam:688967] Signal code: (-6) [scramjetFoam:688967] Failing at address: 0x3e8000a8347 [scramjetFoam:688967] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f2942e13520] [scramjetFoam:688967] [ 1] /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7f2942e679fc] [scramjetFoam:688967] [ 2] /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7f2942e13476] [scramjetFoam:688967] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f2942e13520] [scramjetFoam:688967] [ 4] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libODE.so(_ZNK4Foam6seulex4seulEdRKNS_5FieldIdEEidiRS2_S4_+0xf0)[0x7f2938046a00] [scramjetFoam:688967] [ 5] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libODE.so(_ZNK4Foam6seulex5solveERdRNS_5FieldIdEEiRNS_9ODESolver9stepStateE+0x2bc)[0x7f293804735c] [scramjetFoam:688967] [ 6] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libODE.so(_ZNK4Foam9ODESolver5solveEddRNS_5FieldIdEEiRd+0x30f)[0x7f293803153f] [scramjetFoam:688967] [ 7] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libchemistryModel.so(_ZNK4Foam3odeINS_14chemistryModelINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEEEE5solveERdSF_RNS_5FieldIdEEiSF_SF_+0x1fe)[0x7f29386c907e] [scramjetFoam:688967] [ 8] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libchemistryModel.so(_ZN4Foam14chemistryModelINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEE5solveINS_12UniformFieldIdEEEEdRKT_+0x7f4)[0x7f2938664534] [scramjetFoam:688967] [ 9] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libchemistryModel.so(_ZN4Foam14chemistryModelINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEE5solveEd+0x36)[0x7f2938664f76] [scramjetFoam:688967] [10] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libcombustionModels.so(_ZN4Foam16combustionModels7laminar7correctEv+0x2e7)[0x7f2930191d17] [scramjetFoam:688967] [11] /home/scramjetfoam/OpenFOAM/scramjetfoam-dev/platforms/linux64GccDPInt32Opt/lib/libshockMulticomponentFluid.so(_ZN4Foam7solvers24shockMulticomponentFluid20compositionPredictorEv+0x1e7)[0x7f29392afb37] [scramjetFoam:688967] [12] /home/scramjetfoam/OpenFOAM/scramjetfoam-dev/platforms/linux64GccDPInt32Opt/lib/libshockMulticomponentFluid.so(_ZN4Foam7solvers24shockMulticomponentFluid23thermophysicalPredictorEv+0xd)[0x7f29392b179d] [scramjetFoam:688967] [13] foamRun(+0x3fea)[0x55dfaf53efea] [scramjetFoam:688967] [14] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7f2942dfad90] [scramjetFoam:688967] [15] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7f2942dfae40] [scramjetFoam:688967] [16] foamRun(+0x4795)[0x55dfaf53f795] [scramjetFoam:688967] *** End of error message *** at ??:? [2] #9 Foam::combustionModels::laminar::correct() at ??:? [3] #9 Foam::combustionModels::laminar::correct() at ??:? [0] #12 at ??:? [3] # at ??:? [2] #10 10 Foam::solvers::shockMulticomponentFluid::compositionPredictor()Foam::solvers::shockMulticomponentFluid::compositionPredictor()? in "/home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/foamRun" [0] #13 ?-------------------------------------------------------------------------- Primary job terminated normally, but 1 process returned a non-zero exit code. Per user-direction, the job has been aborted. -------------------------------------------------------------------------- at ??:? [3] #11 Foam::solvers::shockMulticomponentFluid::thermophysicalPredictor() at ??:? [3] #12 ? in "/home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/foamRun" [3] #13 ? in "/lib/x86_64-linux-gnu/libc.so.6" [3] #14 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" [0] #14 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" [0] #15 ? in "/home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/foamRun" [scramjetFoam:688966] *** Process received signal *** [scramjetFoam:688966] Signal: Floating point exception (8) [scramjetFoam:688966] Signal code: (-6) [scramjetFoam:688966] Failing at address: 0x3e8000a8346 [scramjetFoam:688966] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7ffa3b645520] [scramjetFoam:688966] [ 1] /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7ffa3b6999fc] [scramjetFoam:688966] [ 2] /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7ffa3b645476] [scramjetFoam:688966] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7ffa3b645520] [scramjetFoam:688966] [ 4] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libODE.so(_ZNK4Foam6seulex4seulEdRKNS_5FieldIdEEidiRS2_S4_+0xf0)[0x7ffa306c8a00] [scramjetFoam:688966] [ 5] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libODE.so(_ZNK4Foam6seulex5solveERdRNS_5FieldIdEEiRNS_9ODESolver9stepStateE+0x2bc)[0x7ffa306c935c] [scramjetFoam:688966] [ 6] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libODE.so(_ZNK4Foam9ODESolver5solveEddRNS_5FieldIdEEiRd+0x30f)[0x7ffa306b353f] [scramjetFoam:688966] [ 7] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libchemistryModel.so(_ZNK4Foam3odeINS_14chemistryModelINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEEEE5solveERdSF_RNS_5FieldIdEEiSF_SF_+0x1fe)[0x7ffa28a7f07e] [scramjetFoam:688966] [ 8] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libchemistryModel.so(_ZN4Foam14chemistryModelINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEE5solveINS_12UniformFieldIdEEEEdRKT_+0x7f4)[0x7ffa28a1a534] [scramjetFoam:688966] [ 9] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libchemistryModel.so(_ZN4Foam14chemistryModelINS_19sutherlandTransportINS_7species6thermoINS_11janafThermoINS_10perfectGasINS_6specieEEEEENS_22sensibleInternalEnergyEEEEEE5solveEd+0x36)[0x7ffa28a1af76] [scramjetFoam:688966] [10] /home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/lib/libcombustionModels.so(_ZN4Foam16combustionModels7laminar7correctEv+0x2e7)[0x7ffa305dfd17] [scramjetFoam:688966] [11] /home/scramjetfoam/OpenFOAM/scramjetfoam-dev/platforms/linux64GccDPInt32Opt/lib/libshockMulticomponentFluid.so(_ZN4Foam7solvers24shockMulticomponentFluid20compositionPredictorEv+0x1e7)[0x7ffa31ae6b37] [scramjetFoam:688966] [12] /home/scramjetfoam/OpenFOAM/scramjetfoam-dev/platforms/linux64GccDPInt32Opt/lib/libshockMulticomponentFluid.so(_ZN4Foam7solvers24shockMulticomponentFluid23thermophysicalPredictorEv+0xd)[0x7ffa31ae879d] [scramjetFoam:688966] [13] foamRun(+0x3fea)[0x5558b77f1fea] [scramjetFoam:688966] [14] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7ffa3b62cd90] [scramjetFoam:688966] [15] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7ffa3b62ce40] [scramjetFoam:688966] [16] foamRun(+0x4795)[0x5558b77f2795] [scramjetFoam:688966] *** End of error message *** at ??:? [2] #11 Foam::solvers::shockMulticomponentFluid::thermophysicalPredictor() at ??:? [2] #12 ? in "/home/scramjetfoam/OpenFOAM/OpenFOAM-dev/platforms/linux64GccDPInt32Opt/bin/foamRun" [2] #13 ? in "/lib/x86_64-linux-gnu/libc.so.6" [2] #14 __libc_start_main-------------------------------------------------------------------------- mpirun noticed that process rank 1 with PID 0 on node scramjetFoam exited on signal 8 (Floating point exception).
-
@李东岳 多谢李老师,解析写的很清晰,基本弄明白了
-
我注意到,在 OpenFOAM 的官方算例中,fvSchemes 中的设置都如下:
divSchemes { default none; div(tauMC) Gauss linear; }
同时注意到官方案例都没有采用湍流模型,而是使用的 laminar。如果使用 LES,divSchemes 是否需要改变?例如:
divSchemes { default none; div(tauMC) Gauss linear; div(phi,U) Gauss limitedLinearV 1; //div(phi,Yi_h) Gauss limitedLinear 1; div(phi,K) Gauss limitedLinear 1; div(phid,p) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1; div(phi,k) Gauss limitedLinear 1; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; }
我注意到 rhoCentralFoam 是根据 rhoU 和 rhoE 求解的,但是对湍流情况的设置还是不是很理解。特别是 div(phi,U) 和 div(((rho*nuEff)*dev2(T(grad(U)))))。
-
@李东岳 李老师,我根据别人支持2D与3D的 AMR代码更新到了最新版本,3D跑着没问题,2D还是报错了
-
@JqBu 请问这个问题解决了吗?我最近做了点二维AMR,运行也是如此报错,正在debug
-
@BznW 在 请教:第三代涡识别方法Liutex的代码在linux中运行的问题 中说:
@lizhisongsjtu 感谢分享,请问下在of7下同样编译成功,但运行Rotex -latestTime会出现这种报错是什么原因呢
遇到同样的问题,blockMesh 生成的结构化网格。李老师和 lizhisongsjtu 程序在 Openfoam v9 和v2212下编译使用,都会浮点溢出。
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0.0012 Time = 0.0012 Reading U #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 ? in "/home/scramjetfoam/OpenFOAM/scramjetfoam-9/platforms/linux64GccDPInt32Opt/bin/Rotex" #4 ? in "/lib/x86_64-linux-gnu/libc.so.6" #5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #6 ? in "/home/scramjetfoam/OpenFOAM/scramjetfoam-9/platforms/linux64GccDPInt32Opt/bin/Rotex" Floating point exception
-
-
最近开始使用org最新版本的OpenFOAM,看到动网格模块改变很大,还加入了负载平衡。所以在做测试,但是一直报错,测试案例如下。是设置不对吗?
OpenFOAM-dev-tutorials-shockFluid-shockTube (2).zip -
如上所述
-
看到 cfd online 的后处理代码:compressibleyPlusLES,感觉修改下作为后处理工具,不失为一个更简单直接的方法。
volScalarField yPlusTemp ( IOobject ( "yPlusTemp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("yPlusTemp", dimless, 0.0) ); volVectorField uPlus ( IOobject ( "uPlus", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedVector("uPlus", dimless, vector::zero) ); volScalarField uTau ( IOobject ( "uTau", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("uTau", dimVelocity, 0.0) ); volScalarField yPlus ( IOobject ( "yPlus", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("yPlus", dimless, 0.0) ); Info<< "Reading field UMean\n" << endl; volVectorField UMean ( IOobject ( "UMean", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); Info<< "Reading field U\n" << endl; volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); Info<< "Reading field rho\n" << endl; volScalarField rho ( IOobject ( "rho", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); # include "compressibleCreatePhi.H" Info<< "successs1\n" << endl; autoPtr<basicThermo> pThermo ( basicThermo::New(mesh) ); basicThermo& thermo = pThermo(); Info<< "successs2\n" << endl; autoPtr<compressible::LESModel> sgsModel ( compressible::LESModel::New(rho, UMean, phi, thermo) );
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Application yPlusLES Description Calculates and reports yPlus and uPlus for all wall patches, for the specified times, for compressible LES. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" //#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" //aali #include "compressible/LES/LESModel/LESModel.H" #include "basicThermo.H" //ali #include "wallFvPatch.H" #include "LESModel.H" #include "nearWallDist.H" #include "wallDist.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { timeSelector::addOptions(); #include "setRootCase.H" # include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); # include "createMesh.H" forAll(timeDirs, timeI) { runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; fvMesh::readUpdateState state = mesh.readUpdate(); // Wall distance wallDist y(mesh, true); if (timeI == 0 || state != fvMesh::UNCHANGED) { Info<< "Calculating wall distance\n" << endl; Info<< "Writing wall distance to field " << y.name() << nl << endl; y.write(); } #include "createFields.H" volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y(); volScalarField muEff(sgsModel->muEff()); const fvPatchList& patches = mesh.boundary(); dimensionedScalar uTauAvg("uTauAvg", dimVelocity, 0); const volScalarField muLam(sgsModel->mu()); scalar nPatch = 0; Info<< "Summary: " << nl << endl; forAll(patches, patchi) { const fvPatch& currPatch = patches[patchi]; if (typeid(currPatch) == typeid(wallFvPatch))//isA<wallFvPatch>(currPatch)) { yPlusTemp.boundaryField()[patchi] = d[patchi] *sqrt ( muEff.boundaryField()[patchi]/rho.boundaryField()[patchi] *mag(UMean.boundaryField()[patchi].snGrad()) ) /muLam.boundaryField()[patchi]/rho.boundaryField()[patchi]; const scalarField& YpTemp = yPlusTemp.boundaryField()[patchi]; //effective viscosity used in the calculation of u* uTau.boundaryField()[patchi] = sqrt ( sgsModel->muEff() *mag(UMean.boundaryField()[patchi].snGrad()) /sgsModel->rho() ); const fvPatchScalarField& uTauWall = uTau.boundaryField()[patchi]; dimensionedScalar uTauTmp("uTauTmp", dimVelocity, average(uTauWall)); uTauAvg += uTauTmp; nPatch ++; Info<< "Patch " << patchi << " named " << currPatch.name() << " y+ : min: " << min(YpTemp) << " max: " << max(YpTemp) << " average: " << average(YpTemp) << " avgUGradWall: " << average(mag(U.boundaryField()[patchi].snGrad())) << nl << endl; } } uTauAvg /= nPatch; Info << " avg. friction velocity uTau is: " << uTauAvg.value() << " (averaged over " << nPatch << " wall(s))" << nl <<endl; //yPlus is = u* x y/nu yPlus = y.y() * uTauAvg / ((sgsModel->mu()) / (sgsModel->rho())); uPlus = UMean / uTauAvg; Info << "Writing yPlus and uPlus to corresponding fields." << nl <<endl; yPlus.write(); uPlus.write(); // Info<< "Writing yPlus to field " // << yPlus.name() << nl << endl; // // yPlus.write(); } Info<< "End\n" << endl; return 0; } // ************************************************************************* //
-
@xuqiming 应该都没有特别考虑这个功能,这个也许可以 https://github.com/JieSun-pku/detonationFoam
-
@wangfei9088 确实如此👍
-
@wangfei9088 前段时间用SADDES算了一个case,瞬态还可以,时间平均基本还是瞬态(算了很久),不会是这个原因吧。还有就是近壁面计算的和WALE差别也很大,WALE比较符合物理结果。
-
foamDictionary 0.00056/nuTilda -entry boundaryField.upperWall -set "{type zeroGradient;}"
-
想对计算网格进行归一化尺寸分析,想请教下,如何计算并输出每个网格的大小,deltaXi,deltaYi,deltaZi?
-
@田畔的风 是的,感谢大佬,果然可以了。得抓紧学python了,批量后处理急需。
-
@田畔的风 再次尝试之后(将三角化代码全部注释掉),可以输出了,但显示还是不正确
triang = tri.Triangulation(mesh.points[:, 0], mesh.points[:, 1]) tpc = ax.tricontourf(triang, postData, cmap='jet', levels=16)
正确结果
-
@田畔的风 是用blockMesh生成的三维的结构化网格,不过射流出口做了类似处理:
设置 Triangulatetheslice=True 可以正常读取了,但是这里的代码应该怎么修改呢?直接注释并取消相应参数不行。
-
@田畔的风 尝试在wsl下的Ubuntu中使用代码,可以顺利写出,如下:
但是meshio读取时出现问题。如下:
读取代码
请问是什么原因呢? -
计算时应该可以直接输出,后处理获取没试过,可以使用writeNow计算一步输出。
-
@strive_DUT 明白你的意思了,我最近也在处理相同的问题,也是参考一些后处理中的代码实现。
-
omega 直接 postProcess Ω: vorticity?
-
@coolhhh 是的,而且适用于结构化网格。However, the operation cannot be applied onto surface fields, e.g wallShearStress.
-
有可能,我问了下代码作者,他推荐了一个编写的压力边界条件,我再测试下
-
现在的结果是上面和前后出口,出现了类似了壁面边界的计算结果。但是我仔细检查了它们的边界,设置并没有问题,而且还进一步修改测试了无反射边界。
-
是的李老师,我也是在尝试修改设置,没有明确的思路
-
最近使用一个新的求解器计算平板超声速射流问题,底部为平板并附有射流出口,右侧是超声速来流,左侧面,上面,前后面均为出口。
但是上面和前后面均出现了如下结果,很不物理,请大家帮忙分析下。
一开始我以为是边界设置问题,原来上面和前后面的U、T都是零梯度,后来均改为了无反射边界,结果并没有改善。
-
@heike256 9684x目前应该是最适合hpc的芯片了。比9654强,海鲜市场看到两个卖的,9000块,但是感觉不是很靠谱。想买一个u测一下。
-
@Rachel0096 rhoCentralFoam步长不能太大,先调小试试看
-
@李东岳 是的李老师,这个功能挺有意思的。我前不久写过Pope和Celik Index的类似后处理代码,看到之后新功能就分享给大家了。当然我实现的比较简单,适用性没有那么好,但是足够用了。您说的写到controlDict的思路也可以,这个其实也就是个简单验证,也不需要多优雅~
-
看到OpenFOAM v2212的一个新功能:New turbulence resolution quality estimation,感觉挺有用的,论坛也讨论过多次类似话题。
要是有老师能移植到org版本就更好了,我自己尝试了下,代码能力不行
-
@李东岳 是的,编译通过了。谢谢李老师!
-
根据参考文献,想要定义一个新的输出量
定义如下:
计算如下:
但是,我直接编译报错:
请各位老师指导下 -
@田畔的风 好的,谢谢。
-
@田畔的风 比如我画出的了OH云图,但是我同时想在其上面绘制当量混合分数Zmix=constant这条线。
-
@田畔的风 明白了,我看着应该是指定了特定时间,但是我不太确定。目前我网格数据4千多万,台式机paraview直接打不开了,正好看到了您的回答。请问我的第二个问题,添加等值线的可以指导下吗?谢谢。
-
@田畔的风 大佬,我不太懂python,正在照猫画虎修改您的代码。我想知道,b=10是什么意思呀?有没有办法默认读取latestTime结果。还有就是,如果我想在云图上加上另一个量的等值线,请问可以讲下如何操作吗?
-
@chen_hao 我后处理的程序是这样写的,我不确定,你可以试一下。我也不太懂
Info<< "Calculating LES Resolved Index Quality -> IQη (LESIQ)\n" << endl; // LES Resolved Index Quality of TKE -> IQη = LESIQ volScalarField LESIQ ( IOobject ( "LESIQ", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar ( "LESIQ", dimless, scalar(0) ) ); //LESIQ = 1/(1+0.05*(pow((mu+muSGS)/max(mu, muSmall), (0.53/1.0)))); LESIQ = 1/(1+0.05*(pow(muEff/max(mu, muSmall), (0.53/1.0)))); LESIQ.write();
-
@李东岳 李老师,我尝试了下,好像不可以。
writeObjects writeObjects(tc) write: --> FOAM Warning : From function virtual Foam::wordList Foam::functionObjects::writeObjectsBase::objectNames() in file db/functionObjects/writeObjectsBase/writeObjectsBase.C at line 65 Object tc not found in database. Available objects:
133 ( AR AR_0 AR_0_0 CO CO2 CO2_0 CO2_0_0 CO_0 CO_0_0 GradT H H2 H2O H2O2 H2O2_0 H2O2_0_0 H2O_0 H2O_0_0 H2_0 H2_0_0 HE HE_0 HE_0_0 HO2 HO2_0 HO2_0_0 H_0 H_0_0 MagGradT N2 O O2 O2_0 O2_0_0 OH OHMean OHPrime2Mean OH_0 OH_0_0 O_0 O_0_0 Pmax Qdot QdotMean QdotPrime2Mean R RR.AR RR.CO RR.CO2 RR.H RR.H2 RR.H2O RR.H2O2 RR.HE RR.HO2 RR.N2 RR.O RR.O2 RR.OH Residuals<scalar> Residuals<vector> T TMean TPrime2Mean U UMean UPrime2Mean U_0 U_0_0 alphat boundary cellZones chemistryProperties combustionProperties data delta deltaTChem devTau e e_0 e_0_0 epsilon faceZones faces fmix fmixMean fmixPrime2Mean fmix_0 fmix_0_0 fvOptions fvSchemes fvSolution k momentumTransport muEff mut neg neighbour nut owner p pMean pPrime2Mean p_0 p_0_0 phi pointConstraints pointMesh pointZones points pos rho rhoE rhoE_0 rhoE_0_0 rhoU rhoU_0 rhoU_0_0 rho_0 rho_0_0 tetBasePtIs thermo:alpha thermo:mu thermo:psi thermo:psi_0 thermophysicalProperties thermophysicalTransport volPointInterpolate(OH) volPointInterpolate(Qdot) volPointInterpolate(T) volPointInterpolate(U) volPointInterpolate(fmix) volPointInterpolation )
openfoam 10 中怎么按某场的特征动态加密网格?
如何布置正弦内部场?
自适应时间步长统一输出精度问题
自适应时间步长统一输出精度问题
如何布置正弦内部场?
paraview处理数据
燃烧求解在AMR之后报错
燃烧求解在AMR之后报错
overinterdymfoam的一些疑问
燃烧求解在AMR之后报错
燃烧求解在AMR之后报错
关于 rhoCentralFoam 中 fvSchemes 设置的疑问。
关于 rhoCentralFoam 中 fvSchemes 设置的疑问。
openfoam 10 中怎么按某场的特征动态加密网格?
openfoam 10 中怎么按某场的特征动态加密网格?
请教:第三代涡识别方法Liutex的代码在linux中运行的问题
OpenFOAM-dev 支持二维AMR吗?测试计算一直报错。
OpenFOAM-dev 支持二维AMR吗?测试计算一直报错。
计算模型壁面不是平坦的边界,paraview能不能提取距离壁面固定高度的切面
LES直流槽道边界层模拟,如何得到正则化速度u+以及正则化坐标y+?
基于reactingFoam的管道内预混氢气点火爆炸
Wray-Agarwal湍流模型
Wray-Agarwal湍流模型
openfoam暂停计算后如何更换新的边界条件后,继续计算?
如何输出每个网格单元的尺寸
python进行OpenFOAM流场后处理
python进行OpenFOAM流场后处理
python进行OpenFOAM流场后处理
python进行OpenFOAM流场后处理
openfoam化学反应模拟如何导出组分的反应源项
请教各位大佬,下图公式中的三项怎么在OpenFOAM或者其他后处理软件中导出呢?
请教各位大佬,下图公式中的三项怎么在OpenFOAM或者其他后处理软件中导出呢?
展向平均
出口处的奇怪现象
出口处的奇怪现象
出口处的奇怪现象
出口处的奇怪现象
展向平均
200万网格并行算力测试(OpenFOAM版本)
rhoCentralFoam发散,出现Maximum number of iterations exceeded
湍流分辨率质量估计--OpenFOAM v2212的一个新功能
湍流分辨率质量估计--OpenFOAM v2212的一个新功能
定义了一个新的输出量,但是编译错误error: no viable overloaded '='
定义了一个新的输出量,但是编译错误error: no viable overloaded '='
python进行OpenFOAM流场后处理
python进行OpenFOAM流场后处理
python进行OpenFOAM流场后处理
python进行OpenFOAM流场后处理
每个时间步文件夹下没有数据写入,求大神!
请问如何写出或者访问化学反应时间尺度tc (chemical time scale)?