@李东岳 intensive variable是密集变量的意思么?图中那个截面的网格进行了网格加密,加密尺寸1mm。处理的变量是气相温度、组分质量分数这些。
香柏树
帖子
-
-
@李东岳 谢谢李老师。请教下这样的表达式最后获得的应该是一个独立的数值,而不是流场内某一平面各个网格对应的数值?如果是这样的话,散点图就无法进行绘制啊,不知道理解对不对
-
@LiuWenchao 好的,非常感谢!
-
在使用PaSR模型计算燃烧流场时,根据一个截面上某一时刻的网格点出了瞬时混合分数、温度和CH2O的散点图。审稿人说网格分布不均匀(左图),这样的处理方式不合理,让用conditionally volume-averaged quantities方式进行后处理。请问这种方式如何后处理呢?我现在把数据点取为时均值,也就是平均的混合分数、温度和CH2O(右图),请问这种方法合理么?
-
@LiuWenchao 您好,请问可以分享下哪篇文章对甲烷层流火焰进行了验证,证明了δ/sf对当量比依赖性较低啊?谢谢!
-
@wangfei9088 对,是时间常数。您的意思是在PaSR模型中该常数与当量比无关?但是时间常数是由流动和化学反应特征时间定义的啊,火焰传播速度和厚度却又和当量比相关,感觉有点矛盾呢
-
PaSR模型中的模型常数(Cmix)取决于流动特征时间、化学反应特征时间,也就是和层流火焰速度和厚度相关。当流场内某个区域当量比变化非常剧烈的时候,比如从1.5降低至0.5,这时候层流火焰速度和厚度怎么确定的呢?
-
@Tens 前辈,请问您解决了么?我也在做输出每一个组分对应的扩散项,没弄出来
-
前期用sprayFoam计算了喷雾燃烧,审稿人提问计算过程中是否限制了parcel的最小数目和最小粒径,请问大家知道OpenFOAM中怎么实现的么?
当时并没有考虑到这方面的因素,只是根据文献(Srinivasan et al., Quality and reliability of LES, Springer, 2011)计算了下每个网格对应的parcel数目小于8,便开启流场计算了。目前的喷嘴设置模型如下图,破碎模型选用默认的ReitzDiwakar Model
-
@liuwenchao 好的,谢谢前辈!
-
@liuwenchao 请问前辈您有和输出焓值和反应速率相关的资源推荐么?我在文献上看到的也是您说的这个公式,一直没找到实现方法
-
@fkingdom 请问前辈找到方法了么?可以指导下么?我最近也在尝试后处理提取低温反应和高温反应的放热率,思路是每个反应的化学反应速率乘以其焓值,具体实现方法还在探索。
-
@星星星星晴 好的 我查下原始文献。谢谢前辈!
-
@星星星星晴 感谢前辈悉心指导!关于您说的问题,我今天查阅了一些公式,关于您提的四个问题,具体回复如下:
- 根据图1中液滴阻力的公式,在100%和200%air中的阻力分别为3.7e-6N和2.3e-5N,也就是液滴受到的阻力变大了,是不是说明液滴更倾向于保持目前的球形状态呢?
- 破碎模型用的是ReitzDiwakar model,具体公式如图中所示,计算得到100%和200%air中的rstable分别为18μm和1.2μm,也就是说后者的液滴粒径更小。这里您说的破碎模型如何处理质量是什么意思呢?是指公式中的密度么?
- “Case2中的液滴数目(nParticles)”说错了,应该是流域内的parcels的数目,也就是图2中的8370.计算结果显示200%air case中的parcels数目比100%air case少了近一半。
- Flowrateprofile constant已经改正。
再次感谢前辈指点!
-
@星星星星晴 谢谢前辈!100%和200%代表计算域进口空气流量的相对值,比如100%是1kg/s的话,200%就是2kg/s。流场内空气速度增大了两倍左右,没有开启碰撞模型,sprayCloudProperties文件内容具体如下:
\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class dictionary; location "constant"; object SprayCloudProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solution { active true; coupled true; transient yes; cellValueSourceCorrection on; maxCo 0.3; sourceTerms { schemes { rho explicit 1; U explicit 1; Yi explicit 1; h explicit 1; radiation explicit 1; } } interpolationSchemes { rho cell; U cellPoint; thermo:mu cell; T cell; Cp cell; kappa cell; p cell; } integrationSchemes { U Euler; T analytical; } } constantProperties { T0 300; // place holders for rho0 and Cp0 // - reset from liquid properties using T0 rho0 744; Cp0 2090; Tvap 298; Tbp 489; constantVolume false; } subModels { particleForces { sphereDrag; } injectionModels { model1 { type coneNozzleInjection; SOI 0.029; massTotal 0.0044166; parcelBasisType mass; injectionMethod disc; flowType constantVelocity; UMag 33.0; outerDiameter 0.0007; innerDiameter 0; duration 1.0; position (0 0 -0.03584797); direction (0 0 1); parcelsPerSecond 2000000; massFlowRate 0.0044166; flowRateProfile table ( (0 0.0044166) (1 0.0044166) (2 0.0044166) (3 0.0044166) (4 0.0044166) (5 0.0044166) (6 0.0044166) (7 0.0044166) (8 0.0044166) (9 0.0044166) (10 0.0044166) ); Cd constant 0.9; thetaInner constant 25; thetaOuter constant 30; sizeDistribution { type RosinRammler; RosinRammlerDistribution { minValue 1e-05; maxValue 6e-05; d 4e-05; n 3; } } } dispersionModel none; patchInteractionModel standardWallInteraction; heatTransferModel RanzMarshall; compositionModel singlePhaseMixture; phaseChangeModel liquidEvaporationBoil; surfaceFilmModel none; atomizationModel none; breakupModel ReitzDiwakar; // ReitzKHRT; stochasticCollisionModel none; radiation off; standardWallInteractionCoeffs { type rebound; } RanzMarshallCoeffs { BirdCorrection true; } singlePhaseMixtureCoeffs { phases ( liquid { C12H26 1; } ); } liquidEvaporationBoilCoeffs { enthalpyTransfer enthalpyDifference; activeLiquids ( C12H26 ); } ReitzDiwakarCoeffs { solveOscillationEq yes; Cbag 6; Cb 0.785; Cstrip 0.5; Cs 10; } /* ReitzKHRTCoeffs { solveOscillationEq yes; B0 0.61; B1 40; Ctau 1; CRT 0.1; msLimit 0.2; WeberLimit 6; } */ TABCoeffs { y0 0; yDot0 0; Cmu 10; Comega 8; WeCrit 12; } } cloudFunctions { voidFraction { type voidFraction; } } }
-
@星星星星晴 前辈,您好!我在使用sprayFoam喷射液滴的时候,在两个不同进气流量的case进行计算,case1为100%空气,case2为200%空气,所有的constant,system里的文件设置都一样,仅仅改变了进气流量。进行液滴后处理时发现,Case2的液滴数目(nParticles)比Case1少了近一半,请问您知道是什么原因么?液滴喷射模型设置具体如下:
model1 { type coneNozzleInjection; SOI 0.029; massTotal 0.0044166; parcelBasisType mass; injectionMethod disc; flowType constantVelocity; UMag 33.0; outerDiameter 0.0007; innerDiameter 0; duration 1.0; position (0 0 -0.03584797); direction (0 0 1); parcelsPerSecond 2000000; massFlowRate 0.0044166; flowRateProfile table ( (0 0.0044166) (1 0.0044166) (2 0.0044166) (3 0.0044166) (4 0.0044166) (5 0.0044166) (6 0.0044166) (7 0.0044166) (8 0.0044166) (9 0.0044166) (10 0.0044166) ); Cd constant 0.9; thetaInner constant 25; thetaOuter constant 30; sizeDistribution { type RosinRammler; RosinRammlerDistribution { minValue 1e-05; maxValue 6e-05; d 4e-05; n 3; } } }
-
目前计算一个喷雾燃烧场时,想改变下燃油喷射位置,因此把几何模型的喷嘴结构(5mm圆孔)向上游移动了10mm, map前在system文件夹下创建了mapFieldsDict文件,具体信息如图1所示;然后在对应时刻文件夹下建立了和原始计算场相同时刻的文件(共125个)。在map时使用了1)mapFields /OF6/P25;2)mapFields /OF6/P25 -sourceTime 0.116555 -mapMethod mapNearest -targetRegion region0两种方式均出现phi未能成功map,同时PaSR_kappa和PaSR_Qdot,sprayCloud类文件除了sprayCloudTheta文件,其余均未能map过来,如图2所示。另外在现有map结果基础上试算了下,log和err文件如图3所示,在读取化学反应机理时浮点溢出了,尝试了foamChemistryReader和new format均未能解决。请问这俩问题大家有什么方法解决么?万分感谢!
-
@ir77 解决了,需要设置一个误差限,使if语句里二者的值小于误差限就默认二者相等了。
-
@星星星星晴 非常感谢!我找找看
-
@lts 您好!请问您是改成FoamChemsitryRead后成功了么?我也遇见您图里的错误,改成FoamChemsitryRead后依然报错,可否指教下?非常感谢!
-
最近在写一个燃烧流场后处理的代码,目的是要提取出以燃烧释热率(Qdot)为1E+10J/m3/s的等值面在流向(y方向)的最小坐标,将其定义为Flame lift-off。目前在OF教程中的aachenBomb案例(图1)基础上进行测试,编译成功的代码如下。但是输出的Flame lift-off值(图2)和paraview中提取的流场数据不一致;比如在0.0004s时Flame lift-off值大概是y=0.075,但是后处理程序输出的是0.1。应该是程序没有遍历整个流域的网格,请问大家知道怎么解决么?个人C++小白,如果需要C++语句的撰写修改,请大家指出方向,我去学习下,非常感谢!
\*---------------------------------------------------------------------------*/ #include "argList.H" #include "Time.H" #include "timeSelector.H" #include "fvCFD.H" #include "transformGeometricField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { timeSelector::addOptions(); #include "addRegionOption.H" #include "setRootCase.H" #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); #include "createMesh.H" std::ofstream file("Flame_lifty.plt",ios_base::app); // open a file ++ forAll(timeDirs, timeI) { runTime.setTime(timeDirs[timeI], timeI); Info<< "Reading field Qdot\n" << endl; volScalarField Qdot ( IOobject ( "Qdot", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); scalar MinYlocation = 0.1;// maxmimum y position in domain //scalar MinQdot = 0.0; label index_ = 0; forAll(Qdot, cellI) { if (Qdot[cellI] == scalar(10000000000.0)) { // Info << "caculating y position" << endl; scalar y = mesh.C()[cellI].component(vector::Y); if (y < MinYlocation) { MinYlocation = y; } } } MinYlocation = mesh.C()[index_].component(vector::Y); Info << " Time= " << runTime.value()<<"," << " Flame lift-off=" << MinYlocation << endl ; file << runTime.value() << " " <<MinYlocation << " " << std::endl; } file.close(); //close the file ++ return 0; } // ************************************************************************* //
-
@星星星星晴 谢谢前辈!我尝试下。
-
@李东岳 谢谢李老师指导,这么修改确实不太正确。我从算法上看看如何能够合理些。
-
-
目前在尝试使用sprayFoam等压环境下的C12H26点火延迟时间,由于sprayFoam中通过泊松方程求解压力(见原始pEqn.H),网格内监测压力显示不能保持等压状态。因此参考chemFoam的源代码,想把泊松方程改为完全气体状态方程P=rhoRT(见修改的pEqn.H),同时在sprayFoam.C中注释掉压力修正的过程(见修改的sprayFoam.C)。另外能量方程也改为求解Enthalpy的形式。在OpenFOAM6环境下编译没问题,但是计算两个时间步后即浮点溢出了,计算设置见下楼的图1,错误提示下楼的图2。请问各位前辈有没有解决方法啊?
原始pEqn.Hrho = thermo.rho(); rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); if (pimple.nCorrPISO() <= 1) { tUEqn.clear(); } if (pimple.transonic()) { surfaceScalarField phid ( "phid", fvc::interpolate(psi) *( fvc::flux(HbyA) + MRF.zeroFilter ( rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ) ) ); MRF.makeRelative(fvc::interpolate(psi), phid); while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvm::div(phid, p) - fvm::laplacian(rhorAUf, p) == parcels.Srho() + fvOptions(psi, p, rho.name()) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) { phi == pEqn.flux(); } } } else { surfaceScalarField phiHbyA ( "phiHbyA", ( fvc::flux(rho*HbyA) + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); // Update the pressure BCs to ensure flux consistency constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF); while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - fvm::laplacian(rhorAUf, p) == parcels.Srho() + fvOptions(psi, p, rho.name()) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) { phi = phiHbyA + pEqn.flux(); } } } #include "rhoEqn.H" #include "compressibleContinuityErrs.H" // Explicitly relax pressure for momentum corrector p.relax(); // Recalculate density from the relaxed pressure rho = thermo.rho(); rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); fvOptions.correct(U); K = 0.5*magSqr(U); if (thermo.dpdt()) { dpdt = fvc::ddt(p); }
修改的pEqn.H
{ rho = thermo.rho(); p = rho*Rspecific*thermo.T(); }
修改的sprayFoam.C
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2018 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 sprayFoam Description Transient solver for compressible, turbulent flow with a spray particle cloud. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "turbulentFluidThermoModel.H" #include "basicSprayCloud.H" #include "psiReactionThermo.H" #include "CombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" #include "fvOptions.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "postProcess.H" #include "setRootCaseLists.H" #include "createTime.H" #include "createMesh.H" #include "createControl.H" #include "createTimeControls.H" #include "createFields.H" #include "createFieldRefs.H" #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" turbulence->validate(); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { #include "readTimeControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; parcels.evolve(); #include "rhoEqn.H" #include "YEqn.H" #include "EEqn.H" #include "pEqn.H" /* if (!pimple.frozenFlow()) { #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { // #include "UEqn.H" #include "YEqn.H" #include "EEqn.H" // --- Pressure corrector loop while (pimple.correct()) { #include "pEqn.H" } if (pimple.turbCorr()) { turbulence->correct(); } } rho = thermo.rho(); if (runTime.write()) { combustion->Qdot()().write(); } } else { if (runTime.writeTime()) { parcels.write(); } } */ Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************************************* //
-
三维网格结构很复杂,有12个part。目前二维网格只有一个part,和这个不完全对应有关系么?
-
请问大家知道如何在OpenFOAM中将计算完成的三维结果映射到其内部的一个二维平面么?比如图1中三维线图的流场信息(754万多面体网格)如何映射到正方形平面上,这样就能通过代码单独分析该平面上的数据了。目前代码难以在三维计算域执行,而且仅适用于OF默认格式的文件,所以sample方法在此处也难以应用。
我现在尝试了方法是这样的:
1)针对正方形平面画完二维网格(厚度方向为1个网格,总网格数量8160,所有平面均建立一个part内)后,单独建立个被映射算例目录,里面包含0时刻和最新时刻的文件,system中也包含mapFieldsDict文件,文件信息如图2所示。
2)将system中controlDict中startTime 改为要映射的时刻。
3)在被映射算例目下,建立映射时刻文件夹,里面建立个组分C2H2的文件进行尝试,文件内容如图3所示。
4)输入命令:mapField <源文件目录>,运行记录和错误如下所示。
log文件/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 8 \\/ M anipulation | \*---------------------------------------------------------------------------*/ Build : 8 Exec : mapFields /scratch/users/nus/e0920926/OF6/MS-TDAC Date : Apr 19 2022 Time : 11:06:22 Host : "std0120" PID : 13053 I/O : uncollated Case : /scratch/users/nus/e0920926/OF5/CE nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Source: "/scratch/users/nus/e0920926/OF6" "MS-TDAC" Target: "/scratch/users/nus/e0920926/OF5" "CE" Create databases as time --> FOAM Warning : From function virtual void Foam::Time::readDict() in file db/Time/TimeIO.C at line 408 Reading "/scratch/users/nus/e0920926/OF6/MS-TDAC/system/controlDict" from line 18 to line 169 Selecting compressed binary is inefficient and ineffective, resetting to uncompressed binary --> FOAM Warning : From function virtual void Foam::Time::readDict() in file db/Time/TimeIO.C at line 408 Reading "/scratch/users/nus/e0920926/OF5/CEMA/system/controlDict" from line 18 to line 155 Selecting compressed binary is inefficient and ineffective, resetting to uncompressed binary Source time: 0.110675 Target time: 0.110675 Create meshes Source mesh size: 7547729 Target mesh size: 8160 --> FOAM Warning : From function Foam::triFace Foam::tetIndices::faceTriIs(const Foam::polyMesh&) const in file meshes/polyMesh/polyMeshTetDecomposition/tetIndicesI.H at line 76 No base point for face 41258162, 6(32185316 32185317 31764850 30956255 31547018 30861795), produces a valid tet decomposition. --> FOAM Warning : From function Foam::triFace Foam::tetIndices::faceTriIs(const Foam::polyMesh&) const in file meshes/polyMesh/polyMeshTetDecomposition/tetIndicesI.H at line 76 No base point for face 41258164, 4(30956255 31764850 31416084 31554407), produces a valid tet decomposition. --> FOAM Warning : From function Foam::triFace Foam::tetIndices::faceTriIs(const Foam::polyMesh&) const in file meshes/polyMesh/polyMeshTetDecomposition/tetIndicesI.H at line 76 No base point for face 41258167, 4(32569102 32165258 31326296 31085982), produces a valid tet decomposition. --> FOAM Warning : From function Foam::triFace Foam::tetIndices::faceTriIs(const Foam::polyMesh&) const in file meshes/polyMesh/polyMeshTetDecomposition/tetIndicesI.H at line 76 No base point for face 41258168, 6(30957345 31326296 32165258 32289540 31184503 31851659), produces a valid tet decomposition. --> FOAM Warning : From function Foam::triFace Foam::tetIndices::faceTriIs(const Foam::polyMesh&) const in file meshes/polyMesh/polyMeshTetDecomposition/tetIndicesI.H at line 76 No base point for face 5862791, 4(9594118 11818146 4123357 11818190), produces a valid tet decomposition. Mapping fields for time 0.110675 interpolating C2H2
err文件 --> FOAM FATAL IO ERROR: wrong token type - expected Scalar, found on line 24 the punctuation token ')' file: /scratch/users/nus/e0920926/OF5/CEMA/0.110675/C2H2 at line 24. From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::doubleScalar&) in file lnInclude/Scalar.C at line 101. FOAM exiting
针对报错信息,修改了图3中内容好多次,依然无法消除这个错误。请问大家有什么好的解决方法么?
-
借楼请教一个问题:由于三维计算域网格太大,想在OpenFOAM中导出二维中截面上的流场信息,导出数据需要是OF自带的字典文件格式才能进行后处理。请问大家有什么好的方法么?
非常感谢! -
@浪迹天大 您好,参考您说的流程设置后,文件夹内没有文件输出是怎么回事啊?如下图
-
@zhouxu 谢谢,我尝试下。
-
@李东岳 在 如何导出sprayFoam能量方程中的各项参数? 中说:
ddt = fvc::ddt(rho, he);
感谢李老师回复。我按照您说的先声明了时间项后进行计算后,显性离散计算“ddt = fvc::ddt(rho, he);”这块是怎么实现的呢?是在sprayFoam.C文件中加入这句么?还是在后处理中进行啊?初学openfoam有点不太明白
-
目前想分析下能量方程中各项参数(如非定常项、对流项、亚格子项,化学反应源项和扩散项)在总能量中所占比例,针对下面sprayFoam中求解能量方程的EEqn.H文件,请教大家采用什么方法能导出各项参数到新时刻文件夹中呢?
EEqn.H{ volScalarField& he = thermo.he(); fvScalarMatrix EEqn ( fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he) + fvc::ddt(rho, K) + fvc::div(phi, K) + ( he.name() == "e" ? fvc::div ( fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)" ) : -dpdt ) - fvm::laplacian(turbulence->alphaEff(), he) == rho*(U&g) + parcels.Sh(he) + radiation->Sh(thermo, he) + Qdot + fvOptions(rho, he) ); EEqn.relax(); fvOptions.constrain(EEqn); EEqn.solve(); fvOptions.correct(he); thermo.correct(); radiation->correct(); Info<< "T gas min/max " << min(T).value() << ", " << max(T).value() << endl; } drhoedt=fvm::ddt(rho, he);
-
谢谢李老师,我参考您链接里的方法改了WALE.C和.H文件,编译过程都很顺利,但是还是没有输出的Ksgs。想请您帮我看一下,我改动的在图片中,也附上了全部的WALE.C和.H文件。 ```
WALE.C========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2015-2018 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/>. \*---------------------------------------------------------------------------*/ #include "WALE.H" #include "fvOptions.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { namespace LESModels { // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template<class BasicTurbulenceModel> tmp<volSymmTensorField> WALE<BasicTurbulenceModel>::Sd ( const volTensorField& gradU ) const { return dev(symm(gradU & gradU)); } template<class BasicTurbulenceModel> tmp<volScalarField> WALE<BasicTurbulenceModel>::k ( const volTensorField& gradU ) const { volScalarField magSqrSd(magSqr(Sd(gradU))); return tmp<volScalarField> ( new volScalarField ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_ ), sqr(sqr(Cw_)*this->delta()/Ck_)* ( pow3(magSqrSd) /( sqr ( pow(magSqr(symm(gradU)), 5.0/2.0) + pow(magSqrSd, 5.0/4.0) ) + dimensionedScalar ( "small", dimensionSet(0, 0, -10, 0, 0), small ) ) ) ) ); } template<class BasicTurbulenceModel> void WALE<BasicTurbulenceModel>::correctNut() { k_ = (this->k(fvc::grad(this->U_))); this->nut_ = Ck_*this->delta()*sqrt(k_); this->nut_.correctBoundaryConditions(); fv::options::New(this->mesh_).correct(this->nut_); BasicTurbulenceModel::correctNut(); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class BasicTurbulenceModel> WALE<BasicTurbulenceModel>::WALE ( const alphaField& alpha, const rhoField& rho, const volVectorField& U, const surfaceScalarField& alphaRhoPhi, const surfaceScalarField& phi, const transportModel& transport, const word& propertiesName, const word& type ) : LESeddyViscosity<BasicTurbulenceModel> ( type, alpha, rho, U, alphaRhoPhi, phi, transport, propertiesName ), Ck_ ( dimensioned<scalar>::lookupOrAddToDict ( "Ck", this->coeffDict_, 0.094 ) ), k_ ( IOobject ( IOobject::groupName("k", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_, IOobject::MUST_READ, IOobject::AUTO_WRITE ), this->mesh_ ), Sd_ ( IOobject ( Cw_ ( dimensioned<scalar>::lookupOrAddToDict ( "Cw", this->coeffDict_, 0.325 ) ) { if (type == typeName) { this->printCoeffs(type); } } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class BasicTurbulenceModel> bool WALE<BasicTurbulenceModel>::read() { if (LESeddyViscosity<BasicTurbulenceModel>::read()) { Ck_.readIfPresent(this->coeffDict()); Cw_.readIfPresent(this->coeffDict()); return true; } else { return false; } } template<class BasicTurbulenceModel> tmp<volScalarField> WALE<BasicTurbulenceModel>::epsilon() const { volScalarField k(this->k(fvc::grad(this->U_))); return tmp<volScalarField> ( new volScalarField ( IOobject ( IOobject::groupName("epsilon", this->alphaRhoPhi_.group()), this->runTime_.timeName(), this->mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), this->Ce_*k*sqrt(k)/this->delta() ) ); } template<class BasicTurbulenceModel> void WALE<BasicTurbulenceModel>::correct() { LESeddyViscosity<BasicTurbulenceModel>::correct(); correctNut(); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace LESModels } // End namespace Foam // ************************************************************************* //
WALE.H
/---------------------------------------------------------------------------\\ / F ield OpenFOAM: The Open Source CFD Toolbox \ / O peration Website: https://openfoam.org \ / A nd Copyright (C) 2015-2018 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/>.
Class
Foam::LESModels::WALEDescription
The Wall-adapting local eddy-viscosity (WALE) SGS model.Reference: \verbatim Nicoud, F., & Ducros, F. (1999). Subgrid-scale stress modelling based on the square of the velocity gradient tensor. Flow, Turbulence and Combustion, 62(3), 183-200. \endverbatim The default model coefficients are \verbatim WALECoeffs { Ck 0.094; Ce 1.048;e Cw 0.325; } \endverbatim
See also
Foam::LESModels::SmagorinskySourceFiles
WALE.C*---------------------------------------------------------------------------*/
#ifndef WALE_H
#define WALE_H#include "LESModel.H"
#include "LESeddyViscosity.H"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace LESModels
{/---------------------------------------------------------------------------
Class WALE Declaration
*---------------------------------------------------------------------------*/template<class BasicTurbulenceModel>
class WALE
:
public LESeddyViscosity<BasicTurbulenceModel>
{
// Private Member Functions// Disallow default bitwise copy construct and assignment WALE(const WALE&); void operator=(const WALE&);
protected:
// Protected data dimensionedScalar Ck_; dimensionedScalar Cw_; volScalarField k_; // Protected Member Functions //- Return the deviatoric symmetric part of the square of the given // velocity gradient field tmp<volSymmTensorField> Sd(const volTensorField& gradU) const; //- Return SGS kinetic energy // calculated from the given velocity gradient tmp<volScalarField> k(const volTensorField& gradU) const; //- Update the SGS eddy-viscosity virtual void correctNut();
public:
typedef typename BasicTurbulenceModel::alphaField alphaField; typedef typename BasicTurbulenceModel::rhoField rhoField; typedef typename BasicTurbulenceModel::transportModel transportModel; //- Runtime type information TypeName("WALE"); // Constructors //- Construct from components WALE ( const alphaField& alpha, const rhoField& rho, const volVectorField& U, const surfaceScalarField& alphaRhoPhi, const surfaceScalarField& phi, const transportModel& transport, const word& propertiesName = turbulenceModel::propertiesName, const word& type = typeName ); //- Destructor virtual ~WALE() {} // Member Functions //- Read model coefficients if they have changed virtual bool read(); //- Return SGS kinetic energy virtual tmp<volScalarField> k() const { return k(fvc::grad(this->U_)); } //- Return sub-grid disipation rate virtual tmp<volScalarField> epsilon() const; //- Correct Eddy-Viscosity and related properties virtual void correct();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
} // End namespace Foam// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "WALE.C"
#endif// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
-
有关openFoam中LES WALE模型求解Ksgs问题:
1)openFoam计算WALE模型时,没有在各时刻输出k,通过图1的公式和WALE.C文件,知道Ksgs是求解了的。只是没有调用出来。
2)用reactingFoam -postProcess -func turbulenceFields->k -time 0.0466命令得到的k是在总文件夹下的一个日志,打开查看如图2,并不是在某时刻文件夹中或后处理文件夹里。
3)以前用dynamicKEqn模型k是直接输出的,对比了两个模型的.C文件,如图3,将WALE.C做了修改并重新编译,如图4,依旧没有k文件输出。请问大家怎么才能得到Ksgs呢?
-
比如下图采用720核计算时,每次计算完需要合成processor文件夹内的TDAC中的记事本文件,如果不合成的话TDAC内的文件会被新的计算数据覆盖。现在采用reconsturctPar的话,合成时间特别长,而且合成后还要重新分解成720核计算,后处理效率太低。
2)目前有种想法是将每次计算的TDAC数据复制出来单独下载,然后使用python或matlab将TDAC数据进行合成,请问大家有类似的后处理方法么?
-
@tonysoton 感谢!原先尝试过240核,也是报错。今早改变压力求解格式没问题了。
-
@hitsc30 我最近参考这个链接:https://www.cnblogs.com/Xiwang-Sun/p/14911339.html 改了下压力求解格式,在使用下图参数的时候,今天早上错误消失了。你可以尝试下看看
-
@hitsc30 对 只能断断续续算 还在解决中。看你的错误好像是浮点溢出引起的。
-
@hitsc30 没有解决,一直出现这个错误。
-
@wust-liao 自带sandia的案例算了没问题,我是把sandia的rans改为les,换了一个复杂的燃烧室计算的。不知道哪块出问题了,导致只能断断续续地计算
-
@wust-liao 你好,同学。我刚开始用reactingFoam计算甲烷预混燃烧,一直出现mpirun报错,请问你遇到过么,知道怎么解决么?万分感谢~
-
@dzw05 您好,我也在使用coneNozzleInjection模型进行燃烧室喷雾燃烧模拟,燃烧室进出口的速度边界条件分别为turbulentInlet和pressureInletOutletVelocity,压力边界条件分别为zeroGradient和totalPressure。在进行燃烧室内当量比分析的时候有些疑惑,向您请教下。(1)如果燃油流量是0.1kg/s的话,按照您的解释应该massTotal=0.1,duration=1。在time step size为1e-6s的情况下,也就是每个时间步喷入燃油燃油流量0.1/1*0.000001=1e-7kg,这样只有在喷射时间持续了1s的时候燃油在燃烧室内的质量才能达到0.1kg。本节的这段理解正确么?(2)在计算中一个通流时间为0.02s,受限于计算资源,实际计算过程达不到1s。如果我想在1s之前分析燃烧室内的当量比的话,是不是必须燃油喷射时间超过一个通流时间后才能进行分析呢?在一个通流时间后,喷入燃烧室的燃油流量和流出燃烧室的燃油流量之间的差值可以达到平衡么?(3)关于parcelsPerSecond数目的问题,您说的粒子体积是根据下图中的d进行计算的么?
麻烦您了!谢谢! -
@李东岳 我这边尝试好像主要是内存,显卡影响没那么明显
-
@xpqiu 我用256G内存的搞定了,看来还是电脑配置不够高
-
@number44 我也是reconstruct一个时间点进行后处理的,估计是电脑内存不够
-
@zhouxu 好的 我试下看看
-
@xpqiu 用的5.10.0,先是无响应,而后直接退出。
刚导入时错误如下:ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\IO\EnSight\vtkEnSightGoldBinaryReader.cxx, line 260 vtkEnSightGoldBinaryReader (000001B81ED088A0): stat failed. ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\IO\EnSight\vtkEnSightGoldBinaryReader.cxx, line 1263 vtkEnSightGoldBinaryReader (000001B81ED088A0): Unable to open file: D:\00-OF\OF-6\MLETCC\MCKLES\EN\/MCKLES.0000.sprayCloud ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\IO\EnSight\vtkEnSightReader.cxx, line 379 vtkEnSightGoldBinaryReader (000001B81ED088A0): error reading measured geometry file ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\Common\ExecutionModel\vtkExecutive.cxx, line 753 vtkCompositeDataPipeline (000001B82ED14FD0): Algorithm vtkEnSightGoldBinaryReader(000001B81ED088A0) returned failure for request: vtkInformation (000001B84EAF6B40) Debug: Off Modified Time: 440980 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA FORWARD_DIRECTION: 0 ALGORITHM_AFTER_FORWARD: 1 FROM_OUTPUT_PORT: 0
闪退前错误如下;
-
@xpqiu 您好,我采用700多万网格,360核心计算完转化成Ensight格式,导入paraview后操作两步就闪退了。请问还有其他解决方法么?
-
@李东岳 谢谢李老师!我更改下试试
如何处理conditionally volume-averaged quantities?
如何处理conditionally volume-averaged quantities?
使用PaSR模型时,如何确定当量比变化剧烈的区域内的层流火焰传播速度和厚度?
如何处理conditionally volume-averaged quantities?
使用PaSR模型时,如何确定当量比变化剧烈的区域内的层流火焰传播速度和厚度?
使用PaSR模型时,如何确定当量比变化剧烈的区域内的层流火焰传播速度和厚度?
使用PaSR模型时,如何确定当量比变化剧烈的区域内的层流火焰传播速度和厚度?
OpenFoam中怎么对每个组分分别定义一个变量
如何在sprayFoam中限制parcel 的最小数目和最小粒径?
放热率计算?
放热率计算?
放热率计算?
Euler-Lagrange的一些解析,sprayFoam
Euler-Lagrange的一些解析,sprayFoam
Euler-Lagrange的一些解析,sprayFoam
Euler-Lagrange的一些解析,sprayFoam
OpenFOAM inconsistent三维几何结构map方法?
如何获得流域中等值面的最小流向坐标?
openfoam计算时,显示chemkin文件报错,有人出现过类似错误吗?真诚请教!
openfoam计算时,显示chemkin文件报错,有人出现过类似错误吗?真诚请教!
如何获得流域中等值面的最小流向坐标?
sprayFoam计算等压环境下点火延迟时间
sprayFoam计算等压环境下点火延迟时间
sprayFoam计算等压环境下点火延迟时间
sprayFoam计算等压环境下点火延迟时间
OpenFOAM三维计算结果映射到二维平面
OpenFOAM三维计算结果映射到二维平面
OF如何提取某一个平面内有限区域的矩形内的场数据,并要求OF计算时,每隔固定时间输出?
OF如何提取某一个平面内有限区域的矩形内的场数据,并要求OF计算时,每隔固定时间输出?
如何导出sprayFoam能量方程中的各项参数?
如何导出sprayFoam能量方程中的各项参数?
如何导出sprayFoam能量方程中的各项参数?
LES-WALE中Ksgs如何求解
LES-WALE中Ksgs如何求解
OpenFOAM并行计算后,如何单独合成各核心计算目录下的文件?
mpirun detected that one or more processes exited with non-zero status
mpirun detected that one or more processes exited with non-zero status
mpirun detected that one or more processes exited with non-zero status
mpirun detected that one or more processes exited with non-zero status
reactingFoam计算速度的问题
reactingFoam计算速度的问题
请问有人用过sprayFoam中的下面coneNozzleInjection吗?
算例太大导致用paraview打开后加图层会自动关闭怎么办?
算例太大导致用paraview打开后加图层会自动关闭怎么办?
算例太大导致用paraview打开后加图层会自动关闭怎么办?
算例太大导致用paraview打开后加图层会自动关闭怎么办?
算例太大导致用paraview打开后加图层会自动关闭怎么办?
算例太大导致用paraview打开后加图层会自动关闭怎么办?
算例太大导致用paraview打开后加图层会自动关闭怎么办?
OpenFOAM6中reactingFoam燃料多孔进口边界条件问题: