Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    从0开始计算没问题,停掉再续算过几步就出错

    OpenFOAM
    3
    8
    557
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tens 讲师 last edited by

      在compressibleInterFoam中添加组分方程,组分方程如下:

      tmp<fv::convectionScheme<scalar>> mvConvection
      (
          fv::convectionScheme<scalar>::New
          (
              mesh,
              fields,
              alpharho2Phi,
              mesh.divScheme("div(phi,Yi)")
          )
      );
      
      {
          combustion->correct();
          volScalarField Yt(0.0*Y[0]);
      
          alpharho2 = alpha2*rho2;
          alpharho2Phi = fvc::interpolate(alpharho2)*phi;
          volScalarField alphamuEff("alphamuEff",alpha2*turbulence.muEff());
      
          forAll(Y, i)
          {
              if (i != inertIndex && composition.active(i))
              {
                  volScalarField& Yi = Y[i];
      
                  fvScalarMatrix YEqn
                  (
                      fvm::ddt(alpharho2, Yi)
                    + mvConvection->fvmDiv(alpharho2Phi, Yi)
                    - fvm::laplacian(alphamuEff, Yi)
                   ==
                      parcels.SYi(i, Yi)
                    + combustion->R(Yi)
                    + fvOptions(alpharho2, Yi)
                  );
      
                  YEqn.relax();
      
                  fvOptions.constrain(YEqn);
      
                  YEqn.solve("Yi");
      
                  fvOptions.correct(Yi);
      
                  Yi.max(0.0);
                  Yt += Yi;
              }
      
          }
      
          Y[inertIndex] = scalar(1) - Yt;
          Y[inertIndex].max(0.0);
      
      }
      

      从0时刻开始计算没有问题,在某一时刻停掉计算后续算,没过几步就会报错,报错如下,请问各位有什么建议。
      c0a5616d-30cf-41a2-94dc-ee6f72f73a4e-image.png

      T 1 Reply Last reply Reply Quote
      • T
        Tens 讲师 @Tens last edited by

        顶:ok3:

        李东岳 1 Reply Last reply Reply Quote
        • 李东岳
          李东岳 管理员 @Tens last edited by

          @tens y方程是跟原本求解器偶合在一起的么?

          CFD课程 改成线上了 http://dyfluid.com/class.html
          CFD高性能服务器 http://dyfluid.com/servers.html

          T 1 Reply Last reply Reply Quote
          • T
            Tens 讲师 @李东岳 last edited by

            @李东岳 老师说的耦合具体是指什么呢

            李东岳 1 Reply Last reply Reply Quote
            • 李东岳
              李东岳 管理员 @Tens last edited by

              @tens 除了添加y方程之外,还做了什么其他的改动么。

              CFD课程 改成线上了 http://dyfluid.com/class.html
              CFD高性能服务器 http://dyfluid.com/servers.html

              T 1 Reply Last reply Reply Quote
              • T
                Tens 讲师 @李东岳 last edited by Tens

                @李东岳 就算仿照sprayfoam进行添加的,createFields.H里还添加了下面部分,twoPhaseMixtureThermo里将RhoThermo改为了rhoReactionThermo,应该就这些。

                rhoReactionThermo& thermo2 = mixture.thermo2();
                
                basicSpecieMixture& composition = thermo2.composition();
                PtrList<volScalarField>& Y = composition.Y();
                
                const word inertSpecie(thermo2.lookup("inertSpecie"));
                if (!composition.species().found(inertSpecie))
                {
                   FatalIOErrorIn(args.executable().c_str(), thermo2)
                       << "Inert specie " << inertSpecie << " not found in available species "
                       << composition.species()
                       << exit(FatalIOError);
                }
                
                const label inertIndex(composition.species()[inertSpecie]);
                
                multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
                
                forAll(Y, i)
                {
                   fields.add(Y[i]);
                }
                
                surfaceScalarField alpharho2
                (
                   IOobject
                   (
                       "alphaRho2Phi",
                       runTime.timeName(),
                       mesh,
                       IOobject::READ_IF_PRESENT,
                       IOobject::AUTO_WRITE
                   ),
                   alpha2*rho2
                );
                
                surfaceScalarField alphaRho2Phi
                (
                   IOobject
                   (
                       "alphaRho2Phi",
                       runTime.timeName(),
                       mesh,
                       IOobject::READ_IF_PRESENT,
                       IOobject::AUTO_WRITE
                   ),
                   fvc::interpolate(alpha2*rho2)*phi
                );
                
                F 1 Reply Last reply Reply Quote
                • F
                  Fkingdom @Tens last edited by

                  @tens 您好,我也遇到了相似的情况,请问最后解决了吗?

                  T 1 Reply Last reply Reply Quote
                  • T
                    Tens 讲师 @Fkingdom last edited by

                    @fkingdom 现在没有这个问题了,不过现在的方程以及求解器改动很多,我也不知道是什么导致的这个问题

                    1 Reply Last reply Reply Quote
                    • First post
                      Last post

                    CFD中文网 | 东岳流体 | 京ICP备15017992号-2