@李东岳 好的,谢谢老师指点迷津,我再自己研究一下。
刚刚尝试了一下,相同的算例使用compressibleInterFoam求解器计算,将pMin值设置为负值后很快就会报错负温度。看来不能简单的直接设置为负
打倒小怪兽
帖子
-
FLuent与OpenFOAM中关于压力限制的区别 -
FLuent与OpenFOAM中关于压力限制的区别@李东岳 老师,我还有一个疑问,pMin的值可以设置为负值吗?会有文件对pMin的值必须为非负值的限制吗?
这样是否可以避免直接取消pMin带来的风险? -
FLuent与OpenFOAM中关于压力限制的区别@李东岳 老师,我现在在尝试取消pMin对流场压力的限制,来达到允许流场出现绝对负压的计算结果。
想请教一下老师您,如果我想消除pMin的限制,下面两个方法是否可行?如果思路没问题的话,您觉得有没有可能是存在其他关联文件没有修改的缘故导致的报错?或者,您能花时间指点一下,如何修改求解器来取消pMin限制?目前我尝试了两种方法:
-
直接将compressibleInterFoam求解器文件夹中的压力文件中,将关于pMin的语句直接注释掉的方法(同时在createField中取消pMin的声明),但是重新编译后的求解器运行修改前能正常计算的算例会很快报错(大概三四个时间步)——这个方法不知道该如何再继续推进下去了
-
OpenFOAM-11中是通过fvConstrains-limitPressure来限制压力的,我对这个文件对压力的语句也进行了修改——将max(p,pMin),改为min(p,pMin),然后提供一个巨大的pMin值(1e12)。这样应该也能消除压力下限的限制,但算例的结果也会发现压力和温度计算有问题。
-
-
FLuent与OpenFOAM中关于压力限制的区别@李东岳 老师,这是of2312版本中的adiabaticPerfectFluid公式
我上面给出的公式里面,V表示的是1/ρ,这两个公式应该是一样的。 -
FLuent与OpenFOAM中关于压力限制的区别@李东岳 李老师感谢您的及时回复
在OpenFOAM中液体属性的adiabaticPerfectFluid模型,使用的是Tait状态方程这个模型
其中B的值通过实验测得为3e8,在这种情况下如果绝对负压不超过B的值,就不会出现负密度,这样应该也不会影响到计算吧?我不知道这样理解对不对也有相关领域的液相绝对负压的文献:CAUPIN, F. & HERBERT, E. 2006 Cavitation in water: a review. C. R. Phys. 7 (9–10), 1000–1017.
-
FLuent与OpenFOAM中关于压力限制的区别使用compressibleInterFoam计算气泡动力学问题的时候经常会出现液体内的绝对负压,pMin的作用如:https://www.cfd-online.com/Forums/openfoam-solving/218998-influence-pmin-compressibleinterfoam-oscillatory-pressure-boundary.html
所说,
是防止出现基于气体状态方程计算密度时不能出现绝对负压导致的负密度,但是在液体中一定的绝对负压是被允许的。
fluent中在solution limit有关于pressure-limit的设置,但是根据:https://innovationspace.ansys.com/knowledge/forums/topic/how-does-ansys-fluent-handle-negative-absolute-pressure-for-compressible-multiphase-cases/
中描述的,限制压力只作用于计算材料属性时将其限制为pMin,而正常流场中绝对负压并不作约束。在OpenFOAM中,像是为了限制pMin而将整个流场的压力值全部截断到pMin。现在我想通过把涉及到pMin的文件中相关语句注释掉,来消除pMin的影响。在OpenFOAM-9文件夹中使用grep -r pMin得到如下文件
src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcell.C: const scalar pMin = cmptMin(pCubicAlphas_); src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcell.C: if (root < pMax && root > pMin && rootOld != root) src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.C: return overlapEngine.cellCellOverlapMinDecomp src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C: dict.found("pMin") src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C: || dict.found("pMinFactor") src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C: if (dict.found("pMin")) src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C: << " min " << dict.lookup<scalar>("pMin") src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C: if (dict.found("pMinFactor")) src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C: << " minFactor " << dict.lookup<scalar>("pMinFactor") src/meshTools/tetOverlapVolume/tetOverlapVolume.C:bool Foam::tetOverlapVolume::cellCellOverlapMinDecomp src/meshTools/tetOverlapVolume/tetOverlapVolume.H: bool cellCellOverlapMinDecomp src/meshTools/edgeFaceCirculator/edgeFaceCirculatorI.H: label fpMin1 = f.rcIndex(fp); src/meshTools/edgeFaceCirculator/edgeFaceCirculatorI.H: if (f[fpMin1] == v1) src/meshTools/edgeFaceCirculator/edgeFaceCirculatorI.H: fp = fpMin1; src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C: label fpMin1 = f.rcIndex(fp0); src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C: if (pointLevel_[f[fpMin1]] <= cLevel) src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C: label edgeI = fEdges[fpMin1]; src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8/hexRef8.C: fpMin1, src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: label fpMin1 = fpA; src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: label fp = f.fcIndex(fpMin1); src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: // See where fp sorts. Make sure it is above fpMin1! src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: if (w <= dist[fpMin1]) src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: w = dist[fpMin1] + 1e-6*(dist[fpB] - dist[fpA]); src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: fpMin1 = fp; src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: fp = f.fcIndex(fpMin1); src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: fpMin1 = fpA; src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: fp = f.rcIndex(fpMin1); src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: // See where fp sorts. Make sure it is below fpMin1! src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: if (w <= dist[fpMin1]) src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: w = dist[fpMin1] + 1e-6*(dist[fpB] - dist[fpA]); src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: fpMin1 = fp; src/dynamicMesh/polyTopoChange/polyTopoChange/faceCollapser.C: fp = f.rcIndex(fpMin1); src/lagrangian/molecularDynamics/potential/tetherPotential/derived/pitchForkRing/pitchForkRing.C: scalar pMinusRSqr = sqr(p - rOrbit_); src/lagrangian/molecularDynamics/potential/tetherPotential/derived/pitchForkRing/pitchForkRing.C: -0.5 * mu_ * pMinusRSqr src/lagrangian/molecularDynamics/potential/tetherPotential/derived/pitchForkRing/pitchForkRing.C: + 0.25 * pMinusRSqr * pMinusRSqr src/lagrangian/molecularDynamics/potential/tetherPotential/derived/pitchForkRing/pitchForkRing.C: scalar pMinusR = (p - rOrbit_); src/lagrangian/molecularDynamics/potential/tetherPotential/derived/pitchForkRing/pitchForkRing.C: (mu_ - sqr(pMinusR)) * pMinusR * r.x()/(p + vSmall), src/lagrangian/molecularDynamics/potential/tetherPotential/derived/pitchForkRing/pitchForkRing.C: (mu_ - sqr(pMinusR)) * pMinusR * r.y()/(p + vSmall), src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.H: demandDrivenEntry<scalar> pMin_; src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.H: inline scalar pMin() const; src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.C: if (td.pc() < cloud.constProps().pMin()) src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.C: << " to " << cloud.constProps().pMin() << nl << endl; src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.C: td.pc() = cloud.constProps().pMin(); src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcelI.H: pMin_(this->dict_, 0.0), src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcelI.H: pMin_(cp.pMin_), src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcelI.H: pMin_(this->dict_, "pMin", 1000.0), src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcelI.H:Foam::ReactingParcel<ParcelType>::constantProperties::pMin() const src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcelI.H: return pMin_.value(); src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcel.H: const scalar pMin, src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcelI.H: const scalar pMin, src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcelI.H: pMin, src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C: label fpMin1 = curFace.rcIndex(fp); src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C: else if (nbFace[nbPlus1] == curFace[fpMin1]) src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C: else if (nbFace[nbMin1] == curFace[fpMin1]) src/fvConstraints/limitPressure/limitPressure.H: dimensionedScalar pMin_; src/fvConstraints/limitPressure/limitPressure.C: pMin_.value() = dict.lookup<scalar>("min"); src/fvConstraints/limitPressure/limitPressure.C: scalar pMin = vGreat; src/fvConstraints/limitPressure/limitPressure.C: pMin = min(pMin, min(pbf[patchi])); src/fvConstraints/limitPressure/limitPressure.C: reduce(pMin, minOp<scalar>()); src/fvConstraints/limitPressure/limitPressure.C: pMin_.value() = dict.lookup<scalar>("min"); src/fvConstraints/limitPressure/limitPressure.C: const scalar pMinFactor(dict.lookup<scalar>("minFactor")); src/fvConstraints/limitPressure/limitPressure.C: pMin_.value() = pMinFactor*pMin; src/fvConstraints/limitPressure/limitPressure.C: Info<< " min " << pMin_.value() << nl; src/fvConstraints/limitPressure/limitPressure.C: pMin_("pMin", dimPressure, 0), src/fvConstraints/limitPressure/limitPressure.C: const scalar pMin = min(p).value(); src/fvConstraints/limitPressure/limitPressure.C: if (pMin < pMin_.value()) src/fvConstraints/limitPressure/limitPressure.C: Info<< "limitPressure: p min " << pMin << endl; src/fvConstraints/limitPressure/limitPressure.C: p = min(p, pMin_); applications/solvers/multiphase/compressibleInterFoam/pEqn.H: p = min(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin); applications/solvers/multiphase/compressibleInterFoam/createFields.H:dimensionedScalar pMin applications/solvers/multiphase/compressibleInterFoam/createFields.H: "pMin", applications/solvers/multiphase/compressibleMultiphaseInterFoam/pEqn.H: p = max(p_rgh + mixture.rho()*gh, pMin); applications/solvers/multiphase/compressibleMultiphaseInterFoam/createFields.H:dimensionedScalar pMin("pMin", dimPressure, mixture); applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFields.H:if (fluid.found("pMin")) applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFields.H: << "Pressure limits, pMin and pMax, are now read from " applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/sinteringModels/KochFriedlander/KochFriedlander.C: dpMin_(dict_.lookupOrDefault<scalar>("dpMin", 0)) applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/sinteringModels/KochFriedlander/KochFriedlander.C: Cs_*pow(dp, n_)*pow(T[celli], m_)*exp(Ta_/T[celli]*(1 - dpMin_/dp)); applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/sinteringModels/KochFriedlander/KochFriedlander.H: dpMin | Minimum primary particle diameter | no | 0 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/sinteringModels/KochFriedlander/KochFriedlander.H: scalar dpMin_; tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/thermophysicalProperties:pMin 10000; tutorials/multiphase/compressibleInterFoam/laminar/cylinder/constant/thermophysicalProperties:pMin 10000; tutorials/multiphase/compressibleInterFoam/laminar/sloshingTank2D/constant/thermophysicalProperties:pMin 1000; tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalProperties:pMin 10000; tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/thermophysicalProperties:pMin 10000; tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/constant/thermophysicalProperties:pMin 10000; tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/constant/thermophysicalProperties:pMin 10000; tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVesselAMI2D/constant/phasePropertiesAll:pMin 10000; grep: platforms/linux64GccDPInt32Opt/bin/compressibleInterFoam: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/bin/compressibleMultiphaseInterFoam: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/bin/multiphaseEulerFoam: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/src/sampling/meshToMesh/calcMethod/meshToMeshMethod/meshToMeshMethod.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/src/finiteVolume/cfdTools/general/pressureReference/pressureReference.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/src/meshTools/tetOverlapVolume/tetOverlapVolume.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/src/lagrangian/parcel/clouds/derived/sprayCloud/sprayCloud.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/src/lagrangian/parcel/clouds/derived/reactingMultiphaseCloud/reactingMultiphaseCloud.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/src/lagrangian/parcel/clouds/derived/reactingCloud/reactingCloud.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/src/fvConstraints/limitPressure/limitPressure.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/compressibleMultiphaseInterFoam/compressibleMultiphaseInterFoam.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseEulerFoam.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/diameterModels/velocityGroup/sizeGroup/shapeModels/fractal/sinteringModels/KochFriedlander/KochFriedlander.o: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/lib/libphaseSystem.so: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/lib/libsampling.so: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/lib/libfvConstraints.so: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/lib/liblagrangianParcel.so: 匹配到二进制文件 grep: platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: 匹配到二进制文件 etc/templates/compressibleInflowOutflow/system/fvSolution: pMinFactor 0.1; etc/templates/singleFluidCHT/templates/system/fluid/fvSolution:// pMinFactor 0.1;
其中相关的文件应该只有
applications/solvers/multiphase/compressibleInterFoam/pEqn.H
src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C
src/fvConstraints/limitPressure/limitPressure.C
而pressureReference这一文件的作用应该是识别pMin并将其指向fvConstraints的,我只更改了pEqn和limitPressure这两个文件,将其中pMin的语句注释掉。但是同样的算例文件,更改前能够计算,更改后迭代几个计算步后就会报负温度停止计算。
求助,第一次尝试更改求解器,担心是不是有其他相关的文件没有更改?我这个思路有没有问题?如果我想消除pMin的限制,应该怎么做,我希望的是能够在OpenFOAM实现与fluent相同的处理方式,而不是直接将最终结果也直接截断。
-
在controlDict文件中添加function报错[添加东岳流体中的也会报这个错]@李东岳 固态和机械都有比较大容量,足够计算一个算例了。只要在controlDict文件中添加function词条,就会报错。
在网上查了一下,可能是gcc高版本和OpenFOAM-9中间存在问题。但是我安装了低版本后问题也没有解决 -
在controlDict文件中添加function报错[添加东岳流体中的也会报这个错]我想在controlDict添加function,来输出边界压力,再看看残差,但是只要添加function就会报这个错,是啥可能的原因???
在controlDict中添加是想要输出每个时间步的压力数据,因为我保存整个场的间隔比较大,不适合通过postProcess对结果进行提取[15]error in IOstream "OSHA1stream.sinkFile_" for operation Ostream& operator<<(Ostream&, const word&) [15] [15] file: OSHA1stream.sinkFile_ at line 0. [15] [15] From function virtual bool Foam::IOstream::check(const char*) const [15] in file db/IOstreams/IOstreams/IOstream.C at line 96. /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 9 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application compressibleInterFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 0.000005; deltaT 0.00000000005; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat binary; writePrecision 8; writeCompression off; timeFormat general; timePrecision 10; runTimeModifiable yes; //adjustTimeStep no; maxCo 3; maxAlphaCo 3; maxDeltaT 1; /*functions { volFieldValue1 { type volFieldValue; libs ("libfieldFunctionObjects.so"); log true; writeControl writeTime; writeFields no; regionType patch; name walls; operation volIntegrate; //A single weight field can be specified as before: //weightField alpha1; //or a list specified by: //weightFields (alpha.water rho.water); fields ( p ); } } */ functions { forces { type forces; libs ("libforces.so"); patches (walls); rhoInf 998.8; log on; writeControl timeStep; writeInterval 1; CofR (0 0 0); } }
-
OpenFOAM9interFoam计算液滴,用iso Volume提取液相,为什么会这么破碎?@李东岳 李老师,计算过程中没发散啊,第一幅图我是在 paraview 中用了 ISO volume 过滤器出来的液相图,也搞不懂是啥原因提取出来的东西并不连续
-
OpenFOAM9interFoam计算液滴,用iso Volume提取液相,为什么会这么破碎?包括这个液滴为什么会变形这么奇怪?
-
OpenFOAM9interFoam计算液滴,用iso Volume提取液相,为什么会这么破碎? -
东岳网站上的虚拟机更新@李东岳 好嘞,谢谢李老师
-
东岳网站上的虚拟机更新更新的话只能百度网盘重新下一遍吗?还是能在虚拟机直接更新
-
compressibleinterfoam报错:从objectRegistry region0获取thermo:psi文件失败@HIT_lly 在中间set一个液滴
-
compressibleinterfoam报错:从objectRegistry region0获取thermo:psi文件失败OpenFOAM中compressibleinterfoam求解器使用时,计算完第一个时间步,会报错request for volScalarField thermo:psi from objectRegistry region0 failed
大佬们知道问题出在哪个文件吗?文件都是在depthCharge2D这个算例文件的基础上改写的,因为变动只在blockMesh里,所以感觉system里的文件关系不大?是不是0文件夹中物理场的边界条件设置的问题?我设置的计算域就是想要一个简单的2D三面空气,底面是墙的一个区域。 -
CFD中文网 定位与规范注册成功,好好学习,加油加油!