Skip to content
  • 执行Mach出现not implement的错误

    OpenFOAM
    1
    0 赞同
    1 帖子
    3k 浏览
    A

    在后处理求解马赫数的时候,用Mach执行,但出现如下的错误:

    Time = 0.00056 Selecting thermodynamics package { type hePsiThermo; mixture pureMixture; transport sutherland; thermo eConst; equationOfState perfectGas; specie specie; energy sensibleInternalEnergy; } --> FOAM FATAL ERROR: Not Implemented Trying to construct an genericFvPatchField on patch boundaryInner of field e From function genericFvPatchField<Type>::genericFvPatchField(const fvPatch& p, const DimensionedField<Type, volMesh>& iF) in file genericFvPatchField/genericFvPatchField.C at line 44. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/lib/libOpenFOAM.so" #1 Foam::error::abort() in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/lib/libOpenFOAM.so" #2 Foam::fvPatchField<double>::addpatchConstructorToTable<Foam::genericFvPatchField<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&) in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/lib/libgenericPatchFields.so" #3 Foam::fvPatchField<double>::New(Foam::word const&, Foam::word const&, Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&) in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/bin/Mach" #4 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricBoundaryField(Foam::fvBoundaryMesh const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::List<Foam::word> const&, Foam::List<Foam::word> const&) in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/lib/libfluidThermophysicalModels.so" #5 Foam::heThermo<Foam::psiThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::eConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::heThermo(Foam::fvMesh const&, Foam::word const&) in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/lib/libfluidThermophysicalModels.so" #6 Foam::fluidThermo::addfvMeshConstructorToTable<Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::eConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > > >::New(Foam::fvMesh const&, Foam::word const&) in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/lib/libfluidThermophysicalModels.so" #7 Foam::fluidThermo::New(Foam::fvMesh const&, Foam::word const&) in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/lib/libfluidThermophysicalModels.so" #8 ? in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/bin/Mach" #9 ? in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/bin/Mach" #10 ? in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/bin/Mach" #11 __libc_start_main in "/lib64/libc.so.6" #12 ? in "/WORK/app/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64IccDPOpt/bin/Mach" Aborted (core dumped)

    这种情况我之前是没有遇到过的,于是检查了一下Mach.C的源码:

    #include "calc.H" #include "fluidThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { bool writeResults = !args.optionFound("noWrite"); IOobject Uheader ( "U", runTime.timeName(), mesh, IOobject::MUST_READ ); IOobject Theader ( "T", runTime.timeName(), mesh, IOobject::MUST_READ ); // Check U and T exists if (Uheader.headerOk() && Theader.headerOk()) { autoPtr<volScalarField> MachPtr; volVectorField U(Uheader, mesh); if ( IOobject ( "thermophysicalProperties", runTime.constant(), mesh ).headerOk() ) { // thermophysical Mach autoPtr<fluidThermo> thermo ( fluidThermo::New(mesh) ); volScalarField Cp(thermo->Cp()); volScalarField Cv(thermo->Cv()); MachPtr.set ( new volScalarField ( IOobject ( "Ma", runTime.timeName(), mesh ), mag(U)/(sqrt((Cp/Cv)*(Cp - Cv)*thermo->T())) ) ); } else { // thermodynamic Mach IOdictionary thermoProps ( IOobject ( "thermodynamicProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); dimensionedScalar R(thermoProps.lookup("R")); dimensionedScalar Cv(thermoProps.lookup("Cv")); volScalarField T(Theader, mesh); MachPtr.set ( new volScalarField ( IOobject ( "Ma", runTime.timeName(), mesh ), mag(U)/(sqrt(((Cv + R)/Cv)*R*T)) ) ); } Info<< "Mach max : " << max(MachPtr()).value() << endl; if (writeResults) { MachPtr().write(); } } else { Info<< " Missing U or T" << endl; } Info<< "\nEnd\n" << endl; }

    代码中只要有U,T 和热力学模型就好了,不知道为什么错误提示要构造e这个场?谢谢各位!

  • 滑移网格

    Fluent
    5
    0 赞同
    5 帖子
    7k 浏览

    @gemini 对

  • compressibleFoam &求解器编写思路探讨

    OpenFOAM
    2
    0 赞同
    2 帖子
    5k 浏览
    C

    看到官方的求解器,根本摸不清楚边界条件和有限体积是如何交互的。有人能解释一下这和我上述思路的差别和联系吗?

    粗略看了下,这个求解器完全没用openfoam的思路来,采用的他自己的思路,就像你说的,他在开发这个求解器的时候,可能是有其他的代码(比如同组的Fortran)转过来的。并且完全是面向过程的思想。

    如果你要用OpenFOAM求解的思路,还是看OpenFOAM的求解器比较好他这个就是把求解的过程自己实现了,然而没有使用OpenFOAM自带的方法。

    他的main函数已经写的很清楚了:

    int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "setInputValues.H" #include "createFields.H" #include "readFluxScheme.H" /// Time step loop /// Posts the non-blocking send/recv of fields long int iter = 0; while( runTime.loop() ) { /// 构造通量 #include "constructFaceFlux.H" /// 有限体积离散 #include "sumFlux.H" /// 边界通量修正 #include "boundaryFlux.H" Info << "Iteration = " << ++iter << " "; /// 矩阵计算 #include "stateUpdateLTS.H" Info << " Max residue = " << rhoResidMax << endl; /// 输出结果 runTime.write(); } return 0; }
  • 关于max()函数的疑问

    OpenFOAM
    2
    0 赞同
    2 帖子
    5k 浏览
    H

    nevermind,用gMax代替max就可以了

  • 程序调试中的debug标识怎么设置呢?

    OpenFOAM
    3
    0 赞同
    3 帖子
    5k 浏览
    Y

    :kiss:

  • C++11数组初始化

    Algorithm
    4
    0 赞同
    4 帖子
    7k 浏览
    R

    @wwzhao

    简单的感受了一下两种赋值方式,效率确实很大提高。

    #include <stdio.h> #include <string> #include <chrono> #include <iostream> using namespace std ; class Timer { private: // Type aliases to make accessing nested type easier using clock_t = std::chrono::high_resolution_clock; using second_t = std::chrono::duration<double, std::ratio<1> >; std::chrono::time_point<clock_t> m_beg; public: Timer() : m_beg(clock_t::now()) { } void reset() { m_beg = clock_t::now(); } double elapsed() const { return std::chrono::duration_cast<second_t>(clock_t::now() - m_beg).count(); } }; class SomethingBefore11 { private: int m_array[5]; public: SomethingBefore11() // zero the member array { // If we want the array to have values, we'll have to use assignment here m_array[0] = 1; m_array[1] = 2; m_array[2] = 3; m_array[3] = 4; m_array[4] = 5; } }; class SomethingAfter11 { private: int m_array[5]; public: SomethingAfter11(): m_array { 1, 2, 3, 4, 5 } //zero the member array { } }; int main(){ Timer tBefore11; SomethingBefore11 m_array_before11; std::cout << "Time elapsed: " << tBefore11.elapsed() << ‘n’; Timer tAfter11; SomethingAfter11 m_array_after11; std::cout << "Time elapsed: " << tAfter11.elapsed() << ‘n’; return 0; } [xx OFtutorial0_helloWorld]$ whatAboutThisGuy Time elapsed: 7.506e-06 Time elapsed: 1.47e-07 [xx OFtutorial0_helloWorld]$ whatAboutThisGuy Time elapsed: 8.664e-06 Time elapsed: 1.9e-07 [xx OFtutorial0_helloWorld]$ whatAboutThisGuy Time elapsed: 7.646e-06 Time elapsed: 1.89e-07
  • 物体运动导致的气流扰动

    Fluent
    4
    0 赞同
    4 帖子
    6k 浏览
    G

    也许是数值的、非物理的波动?物体运动每时间步求解一次还是多次?

  • 0 赞同
    2 帖子
    4k 浏览
    L

    填坑,参考官方t13教程(没记错的话,反正题目有个stl,似乎只有这种方法)

  • 0 赞同
    1 帖子
    2k 浏览

    管内气体流动,管壁定温加热,我在计算的时候设置了report:热流密度,对流换热系数,Nu等参数。发现用热流密度反推的对流换热系数和Nu和报告的对不上,相差很大,请教各位老师这是什么原因?谢谢

  • 单核计算没问题,mpi并行无法计算?

    OpenFOAM
    4
    0 赞同
    4 帖子
    7k 浏览
    C

    @cfd-china 我自己写的边界条件里面的,单核计算没有问题,如果不是昨天停电都快算完了,结果也还可以。

  • 0 赞同
    15 帖子
    28k 浏览
    T

    我觉得STARCCM+的网格功能挺6的,笛卡尔/多面体等,控制的参数有限,基本上零基础跟着教程做几遍就差不多了,网格生成速度也很快,比较复杂的几何还是很容易解决的;
    其他的用point wise多一点,复杂的几何自己划分块有点麻烦,如果不能分层很容易混乱,简单几何还是非常便利的;ICEM复杂几何切起来还是比较舒心的;^_^

  • 0 赞同
    1 帖子
    6k 浏览
    李东岳

    0_1516841984913_捕获.PNG
    动图1:河床沙石冲刷运动

    河流的流动会改变河床的形状。底部的沙子以及大石头通常会分为两个区:

    顶层的bed-load zone(有研究河海的么,这个怎么翻译?),其中的颗粒会随之移动; 底层:沙子以及石头会被困住,但是会缓慢的爬行;

    在碎石较多的河床中,较大的沙石倾向于堆积在顶层,这种现象被称之为armoring。个人感觉之所以称之为armoring是因为较大的沙石趋向于在表面,类似一种武装。

    实验表明,在这个区域,大沙石有一个净得向上的运动速度,小颗粒具有一个小的向下的移动速度。 目前对于这种现象的原因尚不清楚。不过现存了一些潜在的理论。例如支持程度比较高的巴西果效应(Brazil Nut Effect)。

    0_1516841984913_捕获.PNG
    动图2:有人晃荡大米里面的密度差不多的小石头

    替代文字
    动图3:进行的计算模拟

    巴西果效应是指如果把两种颗粒的混合物置于容器中,然后施加外加的振荡,体积比较大的颗粒会上升到表层,而较小的颗粒会沉降到底部。关于这种古老的效应的动力学机制至今仍众说纷纭。

    DEM模拟:文中作者采用LIGGGHTS对这个现象进行了模拟,下图可以看出,随着时间的推移,大颗粒漂浮出来。

    0_1516841984913_捕获.PNG
    图4:Nature Communication中的LIGGGHTS模拟

    看起来很有意思 :cheeky:

    本文来自Nature Communication

  • 0 赞同
    4 帖子
    7k 浏览
    L

    @东岳 是的,我看的文献大多数是关注速度,温度和涡量场变化,几乎没有涉及压力场变化,于是我编程计算的时候也没有考虑,结果老师问我为什么,我都不知道如何回答了:xinlei:

  • 发帖!!!

    CFD彩虹条
    1
    0 赞同
    1 帖子
    4k 浏览
    胖猫

    天天净整这乱七八糟的

    sad....

  • 0 赞同
    4 帖子
    8k 浏览

    @Alex 太厉害了,大神,我想学习icem,您还有别的类似的icem实例教程吗,不胜感激

    列表
  • 变比热容计算

    Algorithm
    4
    0 赞同
    4 帖子
    8k 浏览
    L

    之前有点问题,最终如下
    \par $C_p$采用4次多项式分段拟合
    \begin{equation}\label{equ:NS_Cp}
    C_p(T)=a_1+a_2T+a_3T^2+a_4T^3+a_5T^4
    \end{equation}
    \par静焓
    \begin{equation}\label{equ:NS_H}
    H(T)=\int_{T_{0}}^{T_{x}}C_p(T)dT=a_1T+\frac{a_2}{2}T^2+\frac{a_3}{3}T^3+\frac{a_4}{4}T^4+\frac{a_5}{5}T^5+a_6
    \end{equation}
    \par熵
    \begin{equation}\label{equ:NS_S}
    S(T)=\int_{T_{0}}^{T_{x}}C_p(T)\frac{dT}{T}=a_1\ln{T}+a_2T+\frac{a_3}{2}T^2+\frac{a_4}{3}T^3+\frac{a_5}{4}T^4+a_7
    \end{equation}
    \par$\bullet$求解静温(已知总温和马赫数)
    \begin{equation}\label{equNSUs}
    U_s^2=2\left(H(T_{tot})-H(T_{sta})\right)
    \end{equation}
    \begin{equation}\label{equNSmach}
    Mach^2=\frac{U^2}{\gamma(T)R_gT}=\frac{U^2}{\frac{C_p(T)}{C_p(T)-R_g}R_gT}
    \end{equation}
    \par由(\ref{equ:NSmach})和(\ref{equ:NSUs})得
    \begin{equation}\label{equNSTsta}
    T_{sta}=\frac{2\left(H(T_{tot})-H(T_{sta})\right)}{Mach^2\frac{C_p(T_{sta})R_g}{C_p(T_{sta})-R_g}}
    \end{equation}
    $\bullet$求解静压(已知总温、总压和静温)
    \par由p等熵过程
    \begin{equation}
    ds = C_p(T)\frac{dT}{T} -R_g\frac{d p}{p}=0
    \end{equation}
    \par两边同时积分有
    \begin{equation}
    \int_{T_{tot}}^{T_{sta}}C_p(T)\frac{dT}{T} =\int_{p_{tot}}^{p_{sta}} R_g\frac{d p}{p}
    \end{equation}
    \par记
    \begin{equation}
    S(T_{x})=\int_{T_{0}}^{T_{x}}C_p(T)\frac{dT}{T}
    \end{equation}
    \par则
    \begin{equation}
    S(T_{sta}) - S(T_{tot}) = R_g\ln\frac{p_{sta}}{p_{tot}}
    \end{equation}
    \par那么
    \begin{equation}\label{equNS_psta}
    p_{sta}=p_{tot}e^{\left(\frac{S(T_{sta})-S(T_{tot})}{R_g}\right)}
    \end{equation}

  • 0 赞同
    3 帖子
    3k 浏览
    C

    你这个直接在ICEM里面就应该能看出问题吧,在ICEM里面先看看网格质量之类的

  • 0 赞同
    1 帖子
    3k 浏览
    李东岳

    欧拉欧拉那面由于已经在统计学方面已经处理过了,没有噪音。欧拉拉格朗日模拟这面目前有什么文章在处理么?找了找,还没看到。

    As an alternative, Lagrangian methods ‘‘discretize” the density function into ‘‘parcels” that are simulated using Monte-Carlo methods. While quite accurate, as in any statistical approach, Lagrangian methods require a relatively large number of parcels to control statistical noise, and thus are computationally expensive.

  • 1 赞同
    2 帖子
    4k 浏览
    李东岳

    对了,这个问题我在2015年曾经汇报过bug,Henry直接表示建议采用高版本的OpenFOAM:sunglasses:

  • ICEM无法使用“undo”

    Meshy
    14
    0 赞同
    14 帖子
    18k 浏览
    L

    简单的点线面操作撤销是没问题的,检查拓扑或者是操作包含的数量太多ICEM就没办法了,解决这个问题的最好办法就是你在做包含多步操作的问题时候先另存为一下是最保险的,问了一下学长他也是用这个方法的