Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

R

Rachel0096

@Rachel0096
关于
帖子
93
主题
32
群组
0
粉丝
2
关注
11

帖子

最新

  • Pimple中对速度场的操作
    R Rachel0096

    感谢老师们!这里确实是多变量的计算,类似于把单个组分场拆分为很多不同的场来计算,但是输入相同的源项,所以会有两种不同的Y在同一个方程里。程序就是在方程这一步出现了错误,我试试各位老师的方法,多输出一些内容看看哪里出问题了。


  • Pimple中对速度场的操作
    R Rachel0096

    @ice_flow 您好,我也遇到了类似的问题,可以向您请教吗?这是对openfoam2.3.x版本中coalChemistryFoam的改写。大致也是在一个方程中,有两个不同的变量,编译可以通过,但在计算式出现报错incompatible fields for operation [N2] == [N2]。个人感觉也是同样的问题,但不是很清楚要如何去更改。YiEqn部分代码如下:

        for(label i=0; i<Y.size(); i++)
        {
            {
                // volScalarField Yi   = Ysf[nsf][i];
                volScalarField Ymean = Y[i];
    
                volScalarField tempYi
                (
                    IOobject
                    (
                        Y[i].name(),
                        runTime.timeName(),
                        mesh,
                        IOobject::NO_READ,
                        IOobject::NO_WRITE
                    ),
                    0*Y[0],
                    "zeroGradient"
                );
    
                tempYi = Ysf[nsf][i];
    
                WienerTermYi = pow(2*gamma,0.5)*( fvc::grad(tempYi) & dW_sf);
                fvScalarMatrix YiEqn
                (
                      fvm::ddt(rho, tempYi)
                    + mvConvection->fvmDiv(phi, tempYi)
                    - fvm::laplacian(turbulence->muEff()/Sct, tempYi)
                    ==
                      coalParcels.SYi(i, Ymean)
                    + combustion->R(Ymean)
                    + fvOptions(rho, Ymean)
    		        + (rho*WienerTermYi/deltaT)
                );
                YiEqn.relax();
                fvOptions.constrain(YiEqn);
                YiEqn.solve(mesh.solver("tempYi"));
                YiEqn.solve();
                fvOptions.correct(tempYi);
    
                tempYi.max(0.0);
    	        Ysf[nsf][i] = tempYi;
                Yt += tempYi;
            }
        }
    

  • coalChemistryFoam改写
    R Rachel0096

    我在对coalChemistryFoam改写,想把它和随机场方程进行结合。简单来说是对于连续相用一系列随机场进行计算,颗粒相不用(单独计算)。但这就遇到了一个问题,我结合着输运方程来说明:

        for(label i=0; i<Y.size(); i++)
        {
            {
                volScalarField Yi   = Ysf[nsf][i];
                volScalarField Ymean = Y[i];
    
                WienerTermYi = pow(2*gamma,0.5)*( fvc::grad(Yi) & dW_sf);
                fvScalarMatrix YiEqn
                (
                      fvm::ddt(rho, Yi)
                    + mvConvection->fvmDiv(phi, Yi)
                    - fvm::laplacian(turbulence->muEff()/Sct, Yi)
                    ==
                      coalParcels.SYi(i, Ymean)
                    + combustion->R(Ymean)
                    + fvOptions(rho, Ymean)
    		        + (rho*WienerTermYi/deltaT)
                );
                YiEqn.relax();
                fvOptions.constrain(YiEqn);
                YiEqn.solve(mesh.solver("Yi"));
                YiEqn.solve();
                fvOptions.correct(Yi);
    
                Yi.max(0.0);
    	        Ysf[nsf][i] = Yi;
                Yt += Yi;
            }
        }
    

    在这个方程里,Yi指的是随机场的组分项(比如名为N2__01),Ymean指的是平均场的组分项(也就是组分场,名为N2)。颗粒的求解不考虑随机场,来自颗粒的源项被输入到每一个随机场中。但这里就会有一个问题,在计算时,会出现类似incompatible fields for operation [N2] + [N2__01]的报错,我的理解是因为这两个名称不同所导致的。这个问题要怎么去解决?我想的是,或许可以把这三项在方程外部导入到一个临时变量,再输入到方程里,但是不知道怎么用代码去实现。求各位大佬指点。


  • of2.3.x的reactingFoam里的rhoEqn.H对应的代码是什么?
    R Rachel0096

    @李东岳 感谢李老师!原来没有特意写出来的都是同一个:zoule:


  • of2.3.x的reactingFoam里的rhoEqn.H对应的代码是什么?
    R Rachel0096

    我使用的是openfoam2.3.x,其reactingFoam目录是这样的:
    1.png
    其中没有rhoEqn.H,但是代码里有rhoEqn.H:
    2.png
    这样的话,我要怎么去找,它这里引用的rhoEqn.H在openfoam中的哪里?


  • oepnFoam如何初始化非均匀内部标量场
    R Rachel0096

    @xuqiming 论坛里有个名为“【分享+搬运】自定义非均匀inlet U”的帖子,或许可以帮到你


  • cantera计算一维对冲火焰,grid=0时与边界设置条件相差大。
    R Rachel0096

    是想用cantera算一维火焰做FGM表,用在openfoam计算里ToT


  • cantera计算一维对冲火焰,grid=0时与边界设置条件相差大。
    R Rachel0096

    我参考cantera官网示例中的diffusion_flame_batch.py,设置一批应变率变化时的一维对冲火焰解。通过反复调用前一计算结果作为初始解,来逐渐增加或降低应变率,从而得到计算结果。当我按照代码设置应变率上升时(即和源代码中一样设置strain_factor = 1.25),边界结果无明显问题。但当我设置应变率下降时(将strain_factor改为0.8),在燃料侧的grid=0处,其结果中的组分组成随应变率下降而逐渐偏离边界条件。我的燃料设置为Y_O2:0.2,Y_NH3:0.1417,Y_N2:0.6583。取应变率下降循环第50次的结果而言,grid=0处的O2仅为0.15左右,NH3也偏差很大。这个可能是什么原因引起的?

    示例中的源代码部分如下:

    # PART 3: STRAIN RATE LOOP
    
    # Compute counterflow diffusion flames at increasing strain rates at 1 bar
    # The strain rate is assumed to increase by 25% in each step until the flame is
    # extinguished
    strain_factor = 1.25
    
    # Exponents for the initial solution variation with changes in strain rate
    # Taken from Fiala and Sattelmayer (2014)
    exp_d_a = - 1. / 2.
    exp_u_a = 1. / 2.
    exp_V_a = 1.
    exp_lam_a = 2.
    exp_mdot_a = 1. / 2.
    
    # Restore initial solution
    file_name, entry = names("initial-solution")
    f.restore(file_name, name=entry)
    
    # Counter to identify the loop
    n = 0
    # Do the strain rate loop
    while np.max(f.T) > temperature_limit_extinction:
        n += 1
        print('strain rate iteration', n)
        # Create an initial guess based on the previous solution
        # Update grid
        f.flame.grid *= strain_factor ** exp_d_a
        normalized_grid = f.grid / (f.grid[-1] - f.grid[0])
        # Update mass fluxes
        f.fuel_inlet.mdot *= strain_factor ** exp_mdot_a
        f.oxidizer_inlet.mdot *= strain_factor ** exp_mdot_a
        # Update velocities
        f.set_profile('velocity', normalized_grid,
                      f.velocity * strain_factor ** exp_u_a)
        f.set_profile('spread_rate', normalized_grid,
                      f.spread_rate * strain_factor ** exp_V_a)
        # Update pressure curvature
        f.set_profile('lambda', normalized_grid, f.L * strain_factor ** exp_lam_a)
        try:
            # Try solving the flame
            f.solve(loglevel=0)
    

  • Floating point exception (core dumped)
    R Rachel0096

    已解决


  • Floating point exception (core dumped)
    R Rachel0096

    当我使用原本的网格和0设置时,仅更换为新的机理(gri3.0,原机理是一个氢气的机理),此时会出现一些“attempt to use janafThermo<EquationOfState> out of temperature range 300 -> 3000; T = 298K”的warning,但是可以正常进行计算。


  • Floating point exception (core dumped)
    R Rachel0096

    我在使用一个他人编写的of2.3.x上的求解器,使用其随带发来的算例可以正常运行。之后,主要对0、polymesh和机理进行了更换,尝试计算自己的算例,但是在开始计算时出现报错,看上去是在读取机理时出现问题,想请教各位老师,问题是出在哪里?

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    Create time
    
    Create mesh for time = 0
    
    
    Reading g
    Creating reaction model
    
    Selecting chemistry type 
    {
        chemistrySolver EulerImplicit;
        chemistryThermo psi;
    }
    
    Selecting thermodynamics package 
    {
        type            hePsiThermo;
        mixture         reactingMixture;
        transport       sutherland;
        thermo          janaf;
        energy          sensibleEnthalpy;
        equationOfState perfectGas;
        specie          specie;
    }
    
    Selecting chemistryReader foamChemistryReader
    #0  Foam::error::printStack(Foam::Ostream&) at ??:?
    #1  Foam::sigFpe::sigHandler(int) at ??:?
    #2   in "/lib64/libc.so.6"
    #3  Foam::DimensionedField<double, Foam::volMesh>::operator/=(Foam::DimensionedField<double, Foam::volMesh> const&) at ??:?
    #4  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::operator/=(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
    #5  Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::correctMassFractions() at ??:?
    #6  Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::multiComponentMixture(Foam::dictionary const&, Foam::List<Foam::word> const&, Foam::HashPtrTable<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> >, Foam::word, Foam::string::hash> const&, Foam::fvMesh const&) at ??:?
    #7  Foam::reactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::reactingMixture(Foam::dictionary const&, Foam::fvMesh const&) at ??:?
    #8  Foam::heThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::reactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::heThermo(Foam::fvMesh const&, Foam::word const&) at ??:?
    #9  Foam::psiReactionThermo::addfvMeshConstructorToTable<Foam::hePsiThermo<Foam::psiReactionThermo, Foam::SpecieMixture<Foam::reactingMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > > > >::New(Foam::fvMesh const&, Foam::word const&) at ??:?
    #10  Foam::autoPtr<Foam::psiReactionThermo> Foam::basicThermo::New<Foam::psiReactionThermo>(Foam::fvMesh const&, Foam::word const&) at ??:?
    #11  Foam::psiReactionThermo::New(Foam::fvMesh const&, Foam::word const&) at ??:?
    #12  Foam::psiChemistryModel::psiChemistryModel(Foam::fvMesh const&) at ??:?
    #13  Foam::chemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::chemistryModel(Foam::fvMesh const&) at ??:?
    #14  Foam::EulerImplicit<Foam::chemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::EulerImplicit(Foam::fvMesh const&) at ??:?
    #15  Foam::psiChemistryModel::addfvMeshConstructorToTable<Foam::EulerImplicit<Foam::chemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::New(Foam::fvMesh const&) at ??:?
    #16  Foam::autoPtr<Foam::psiChemistryModel> Foam::basicChemistryModel::New<Foam::psiChemistryModel>(Foam::fvMesh const&) at ??:?
    #17  Foam::psiChemistryModel::New(Foam::fvMesh const&) at ??:?
    #18  
     at ??:?
    #19  __libc_start_main in "/lib64/libc.so.6"
    #20  
     at ??:?
    Floating point exception (core dumped)
    

  • 使用sprayFoam求解器设置多喷雾入口算例
    R Rachel0096

    或许是我的表述不够清晰,我想模拟图一所示的构型,两股不同的喷雾分布从不同的喷雾入口注入,我看到之前DieselFoam(或许是sprayFoam的前身)可以通过指定不同的X来喷注两种液体,这应该在sprayFoam中如何实现呢?

    image.png

    image.png


  • 使用sprayFoam求解器设置多喷雾入口算例
    R Rachel0096

    @李东岳 在 使用sprayFoam求解器设置多喷雾入口算例 中说:

    你设置2个进口不就可以了么?

    李老师您好,其实主要问题是我目前不清楚我如何分别为不同出口的喷雾指定不同的液体:zoule:


  • 使用sprayFoam求解器设置多喷雾入口算例
    R Rachel0096

    想请教一下有没有老师之前设置过多个喷雾的算例,我目前想设置两个喷雾入口,并且注射不同的液体,但我对sprayCloudProperties中的subModels实在不熟悉,希望有老师能够指教一番

    subModels
    {
        particleForces
        {
            sphereDrag;
        }
    
        injectionModels
        {
            model1
            {
                type            patchInjection;
                SOI             0;
                massTotal       0.0000147;
                duration        1;
                parcelBasisType fixed;//mass; 
                nParticle       1;
                patchName       INLET_LIQUID;//FUELINLET;
    
                parcelsPerSecond 3.02e8;
                U0              (0 0 0.52);
                flowRateProfile constant 1;
                sizeDistribution
                {
                    type        fixedValue;
                    fixedValueDistribution
                    {
                        value           5e-6;
                    }
                }
            }
        }
    
      
        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;
        }
        TABCoeffs
        {
            y0              0;
            yDot0           0;
            Cmu             10;
            Comega          8;
            WeCrit          12;
        }
    }
    

    Snipaste_2024-08-13_22-18-52.jpg


  • 编译求解器的时候出现undedined reference错误
    R Rachel0096

    @李东岳 李老师,该问题已经解决,是由于部分的options文件多了这一行,导致编译的时候标准不同了。
    acdca921c5fd89eb48d348939f46673.png
    但是在调试算例的时候又出现了如下问题,应该是src中lagrangian有一部分存在问题,但是目前我没找到具体的问题出在哪,不知道是不是版本不同编译导致的?
    2af0c5a594141e5a09ad8bf6f51b79a.png


  • 编译求解器的时候出现undedined reference错误
    R Rachel0096

    各位老师,我想请教在编译求解器的时候出现如下错误应该如何解决:

    *      -lm -o /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/bin/coalFPVFoam
    * /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/lib/libFlameletPCClagrangianIntermediate.so: undefined reference to `Foam::UOPstream::writeQuoted(std::string const&, bool)'
    * /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/lib/libFlameletPCClagrangianIntermediate.so: undefined reference to `Foam::regExp::match(std::string const&) const'
    * /share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/lib/libFlameletPCClagrangianIntermediate.so: undefined reference to `Foam::regExp::regExp(std::string const&, bool)'
    * collect2: error: ld returned 1 exit status
    * make: *** [/share/home/zhoufan/OpenFOAM/zhoufan-7/platforms/linux64GccDPInt32Opt/bin/coalFPVFoam] Error 1
    

    我编译的该求解器是在of6上编写的,我尝试修改之后在of7上进行编译,结果出现上述问题。
    以下是求解器的options文件:
    options.png


  • mapField报错
    R Rachel0096

    自问自答一下,可以参考cfd-online上的这个帖子
    https://www.cfd-online.com/Forums/openfoam-bugs/194353-mapfields-major-bug.html
    OpenFoam通过反向距离插值(reverse distance interpolation)来实现插值

    This interpolation will crash if point from which we interpolate and point interpolate to overlaps.  So in OpenFOAM code this interpolation used only if distance between points is larger than directHitTol variable.

    src/sampling/meshToMesh0/calculateMeshToMesh0Weights.C文件中directHitTol默认为10e-5,将其修改为10e-10🌟可以解决我遇到的这个报错


  • mapField报错
    R Rachel0096

    各位老师,我要计算一个比较大的网格,大概是九千万左右的网格数,一开始设置了一个比较粗的网格,计算了一段时间以后想要映射到这个细网格上面,但是在超算上面映射会报错,想问一下各位老师知道是什么原因吗?
    我用的命令是:

    mapFields ../JICF -consistent
    

    b2b27787-3471-4147-8b74-1603090c5c03-image.png
    还有相请教一下mapFields如何多核并行映射呢,采用-parallel会显示没有这个option(现在真的太慢了)


  • sprayFoam报错
    R Rachel0096

    我的chemistryProperties是这样设置的:

    chemistryType
    {
        chemistrySolver   ode;
        chemistryThermo   psi;
    }
    
    chemistry       on;
    
    initialChemicalTimeStep 1e-8;
    
    EulerImplicitCoeffs
    {
        cTauChem        1;
        equilibriumRateLimiter off;
    }
    
    odeCoeffs
    {
        solver          seulex;
        absTol          1e-12;
        relTol          1e-1;
    }
    
    
    // ************************************************************************* //
    
    
  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]