CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新
    1. 主页
    2. vivian
    V
    • 资料
    • 关注 1
    • 粉丝 0
    • 主题 4
    • 帖子 12
    • 群组 0

    vivian

    @vivian

    879
    资料浏览
    12
    帖子
    0
    粉丝
    1
    关注
    注册时间 最后登录

    vivian 取消关注 关注

    vivian 发布的最新帖子

    • RE: rhoCentralFoam求解器的问题

      谢谢您的回复!:big_mouth:
      结合tutorial中wedge15的算例,我的模拟模型为马赫数2的压缩拐角流动。入口设置了速度边界,出口为超声速出口。采用k-epsilon湍流模型,所需k,epsilon值根据经验公式给出。

      压力场设定为:

      internalField   uniform 100000;
      
      boundaryField
      {
          INLET
          
          {
              type            inletOutlet;
              inletValue      uniform 101325;
              value           uniform 101325;
          }
          
      
          OUTLET
          {
              type            waveTransmissive;
              field           p;
              phi             phi;
              rho             rho;
              psi             thermo:psi;
              gamma           1.3;
              fieldInf        100000;
              lInf            1;
              value           uniform 100000;
          }
      
          BOTTOM
          {
              type            zeroGradient;
      
          }
          TOP
          {
              type            zeroGradient;
          }
          frontAndBackPlanes
          {
              type            empty;
              
          }    
      }
      

      速度设定为:

      dimensions      [0 1 -1 0 0 0 0];
      
      internalField   uniform (600 0 0);
      
      boundaryField
      {
          INLET
          {
              type            supersonicFreestream;
              pInf            100000;
              TInf            300;
              UInf            (600 0 0);
              gamma           1.4;
              value           uniform (662 0 0);
          }
      
          OUTLET
          {
              type            inletOutlet;
              inletValue      uniform (662 0 0);
              value           uniform (662 0 0);
          }
      
          BOTTOM
          {
              type            zeroGradient;
      
          }
          TOP
          {
              type            symmetryPlane;
          }
          frontAndBackPlanes
          {
              type            empty;
              
          } 
          
      }
      

      温度场设置为:

      internalField   uniform 300;
      
      boundaryField
      {
          INLET
          {
              type            inletOutlet;
              inletValue      uniform 300;
              value           uniform 300;
          }
      
          OUTLET
          {
              type            inletOutlet;
              inletValue      uniform 300;
              value           uniform 300;
          }
      
          BOTTOM
          {
              type            zeroGradient;
      
          }
          TOP
          {
              type            symmetryPlane;
          }
          frontAndBackPlanes
          {
              type            empty;
              
          } 
      

      求解器的设置是根据相似算例给出,这个的设置有什么原则吗?我设置的如下,还请多多指点:

      solvers
      {
          "rho.*"
          {
              solver          diagonal;
          }
      
          "p.*"
          {
              solver          PBiCG;
              preconditioner  DILU;
              tolerance       1e-12;
              relTol          0;
          }
      
          "(U|e).*"
          {
              $p;
              tolerance       1e-9;
          }
      
          "(nuTilda).*"
          {
              $p;
              tolerance       1e-10;
          }
      }
      
      PIMPLE
      {
          nOuterCorrectors 1;
          nCorrectors      2;
          nNonOrthogonalCorrectors 0;
      }
      

      Q1:不知道我这样设置边界条件是否合理哪?
      Q2:求解器的选择应该如何设置呢,有什么选择原则,请问有什么资料推荐码?
      Q3:在外部参数设置找不出差错,又有发散产生时,请问如何debug呢?

      发布在 OpenFOAM
      V
      vivian
    • rhoCentralFoam求解器的问题

      最近在看rhoCentralFoam求解器,有一些问题,请教各位:
      在使用openfoam中rhoCentralFoam求解器时,我参照其中的例子结合自身算例,给定了边界条件及初始值,在计算4000步后,出现如下错误:

      --> FOAM FATAL ERROR: 
      Maximum number of iterations exceeded
      
          From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar) const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>]
          in file /home/liyue/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 66.
      
      FOAM aborting
      
      #0  Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-3.0.1/src/OSspecific/POSIX/printStack.C:218
      #1  Foam::error::abort() at ~/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/error.C:249
      #2  Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/errorManip.H:85 (discriminator 4)
      #3  Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::T(double, double, double, double (Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::*)(double, double) const, double (Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::*)(double, double) const, double (Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::*)(double) const) const at ~/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/specie/lnInclude/thermoI.H:66
      #4  Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::TEs(double, double, double) const at ~/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/specie/lnInclude/thermoI.H:425
      #5  Foam::sensibleInternalEnergy<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> >::THE(Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> const&, double, double, double) const at ~/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/specie/lnInclude/sensibleInternalEnergy.H:126
      #6  Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::THE(double, double, double) const at ~/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/specie/lnInclude/thermoI.H:365
      #7  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ~/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/basic/psiThermo/hePsiThermo.C:46 (discriminator 2)
      #8  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ~/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/basic/psiThermo/hePsiThermo.C:143
      #9  ? at ~/OpenFOAM/OpenFOAM-3.0.1/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C:232
      #10  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
      #11  ? at ??:?
      Aborted (core dumped)
      

      结合前面求解e方程残差无变化,我分析,这是由于e的求解修正出现了错误,为查找错误来源,我想在rhoCentralFoam的求解器中加断点,看求解过程中的数值传递与变化。

      于是,我采用了debug模式在rhoCentralFoam.C的215行加入断点,想输出e,结果屏幕输出了大量信息,我应该如何输出才能得到想要的场信息呢?

      1. 如果我想梳理出程序运行的主线,搞清楚从场的离散点到通过离散方法,获得最终求解的代数方程矩阵,我认为最好的办法是从建立场开始,关注场中存储的离散点的信息变化。那么请问如何输出存储点压力,面通量信息的矩阵呢?
      发布在 OpenFOAM
      V
      vivian
    • RE: 关于可压缩高速流求解sonicFoam求解器

      谢谢东岳大神的回复,看了您推荐的,感觉有点明白了,还在挣扎中。

      发布在 OpenFOAM
      V
      vivian
    • 关于可压缩高速流求解sonicFoam求解器

      刚刚开始接触openfoam,要做高超声速的模拟,看了求解器,认为sonicFoam比较合适,看这个求解器有很多疑问,向大神们请教。

      1. sonicFoam求解器
          while (runTime.loop())
          {
              Info<< "Time = " << runTime.timeName() << nl << endl;
      
              #include "compressibleCourantNo.H"
      
              #include "rhoEqn.H"
      
              // --- Pressure-velocity PIMPLE corrector loop
              while (pimple.loop())
              {
                  #include "UEqn.H"
                  #include "EEqn.H"
      
                  // --- Pressure corrector loop
                  while (pimple.correct())
                  {
                      #include "pEqn.H"
                  }
      
                  if (pimple.turbCorr())
                  {
                      turbulence->correct();
                  }
              }
      
              rho = thermo.rho();
      
              runTime.write();
      
              Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
                  << "  ClockTime = " << runTime.elapsedClockTime() << " s"
                  << nl << endl;
          }
      

      Q1. 基于压力基求解,我的理解是"rhoEqn.H"是基于质量守恒方程求得密度,这个方程加fvOptions是基于源项中的密度修正吗?主要来源是哪里呢?

      {
          fvScalarMatrix rhoEqn
          (
              fvm::ddt(rho)
            + fvc::div(phi)
            ==
              fvOptions(rho)
          );
      

      Q2. 求解能量方程,为什么有这一项fvc::ddt(rho, K) + fvc::div(phi, K),求解的能量方程是什么样子的那?感觉跟平时推导的能量方程有很多差距?
      能指点一下这个求解器的推导吗?不胜感激。

      发布在 OpenFOAM
      V
      vivian
    • RE: 关于 phi 和 fvVectorMatrix 的两个问题

      @cfd-china 您好,谢谢您的回复。是替换了的,是我给他速度赋值赋错啦。。

      发布在 OpenFOAM
      V
      vivian
    • RE: 关于simpleFoam中kEpsilon中k和epsilon的设定

      多谢您的回复

      发布在 OpenFOAM
      V
      vivian
    • RE: 关于simpleFoam中kEpsilon中k和epsilon的设定

      谢谢您的回复。我又查了一下,把特征长度L用我的进口长度乘以0.05可以运行了。之前我是看一个视频上选择乘以0.08.您说的松弛因子我一般取为0.8。请问这个的选取有什么规则吗?

      发布在 OpenFOAM
      V
      vivian
    • RE: 关于 phi 和 fvVectorMatrix 的两个问题

      @mengweilm425 您好 看了你的研究过程,觉得很好。我也想这样分步骤运行各个程序,以分清各个量含义。请问您是怎么做到的。我先编译了自己求解器,在文件中加入自己想输出的量,希望在输出中出现想看到的量。结果并没有看到想看的内容。请问您是如何。。

      发布在 OpenFOAM
      V
      vivian
    • 关于simpleFoam中kEpsilon中k和epsilon的设定

      kepsilon模型中k的选择和epsilon的选择根据公式算出,
      0_1476111011982_upload-aaccde47-b559-4023-bc98-ee7f8100e9bf
      但计算结果一直显示发散,如下图
      0_1476111104742_upload-6e7b27bb-d32b-492b-97c2-b6c212a2815a
      我认为是由于k和epsilon的初始值选择不恰当造成的。不知道大家怎么选择这两个值?
      (计算背景:来流0.1m/s的圆柱绕流,雷诺数设置为2000,各边界设置如下:)
      压力设置:

      internalField   uniform 0;
      
      boundaryField
      {
          INLET
          {
              type            freestreamPressure;
             
          }
      
          OUTLET
          {
              type            freestreamPressure;
            
          }
           TOP
          {
              type            zeroGradient;
              
          }
          BOTTOM
          {
             type            zeroGradient;
          }
          CYLI
          {
              type            slip;
          }
          frontAndBack
          {
              type            empty;
          }
      }
      

      速度设置:

      internalField   uniform (0.1 0 0);
      
      boundaryField
      {
         INLET
          {        
                 type         freestream;
              freestreamValue        uniform    (0.1 0 0);
          }
      
          OUTLET
          {
             type         freestream;
             freestreamValue        uniform    (0.1 0 0);
          }
           TOP
          {
             type             zeroGradient;
          }
          BOTTOM
          {
              type            zeroGradient;
          }
          CYLI
          {
              type            fixedValue;
              value           uniform (0 0 0);
          }
          frontAndBack
          {
              type            empty;
          }
      }
      

      nut

      internalField   uniform 0;
      
      boundaryField
      {
          INLET
          {
              type            freestream;
              freestreamValue uniform 0;
          }
      
          OUTLET
          {
              type            freestream;
              freestreamValue uniform 0;
          }
          
          TOP
          {
              type            zeroGradient;
              
          }
          BOTTOM
          {
             type            zeroGradient;
          }
      
          CYLI
          {
              type            kqRWallFunction;
              value           uniform 0;
          }
      
          frontAndBack
          {
              type            empty;
          }
      }
      
      发布在 OpenFOAM
      V
      vivian
    • RE: 运行中残差一直输出为0

      明白了。谢谢~

      发布在 OpenFOAM
      V
      vivian