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中文网

  1. CFD中文网
  2. Fluent
  3. 求助UDF并行计算的问题

求助UDF并行计算的问题

已定时 已固定 已锁定 已移动 Fluent
5 帖子 4 发布者 4.8k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 关 离线
    关 离线
    关伯兰在笑
    写于 最后由 李东岳 编辑
    #1

    各位大佬,求帮忙看一下计算出错的原因。
    我模拟一个结晶的过程,在PBE模型中挂上成核与生长的UDF时,计算一开始就出现了报错,不挂UDF就可以正常计算下去。报错时控制台的提示信息如下:

    Initialize using the hybrid initialization method.
    
    Checking case topology... 
    -This case has both inlets & outlets 
    -Pressure information is not available at the boundaries.
     Case will be initialized with constant pressure
    
    	iter		scalar-0
    
    	1		1.000000e+00
    	2		1.145484e-05
    	3		8.608675e-07
    	4		2.028824e-07
    	5		2.753174e-08
    	6		5.988739e-09
    	7		9.756630e-10
    	8		2.840014e-10
    	9		5.402100e-11
    	10		1.498808e-11
    
    Hybrid initialization is done.
    
    Creating new file G:\.\mass_frac_z=0-rfile_1_1.out
    Creating new file G:\.\mass_frac_z=-40-rfile_1_1.out
    Creating new file G:\.\mass_frac_z=5-rfile_1_1.out
    
      iter  continuity  u-solution   u-crystal  v-solution   v-crystal  w-solution   w-crystal   energy-p1   energy-p2           k     epsilon  paracetamo  water-solu  bf-0-cryst  bf-1-cryst  bf-2-cryst  bf-3-cryst  bf-4-cryst  bf-5-cryst  bf-6-cryst  bf-7-cryst  bf-8-cryst  bf-9-cryst  bf-10-crys  bf-11-crys  bf-12-crys  bf-13-crys  bf-14-crys  vf-crystal     time/iter
     temperature limited to 1.000000e+00 in 1345882 cells on zone 8407 in domain 2
          1  1.0000e+00  6.0854e-04  0.0000e+00  6.0847e-04  0.0000e+00  9.3036e-04  0.0000e+00  8.2651e-03  0.0000e+00  7.5450e-02  1.6778e-01  1.7762e+00  1.6993e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0.0000e+00  0:00:31    1
    
    
    Error at Node 0: floating point exception
    
    Error at Node 1: floating point exception
    
    Error at Node 2: floating point exception
    Error at Node 3: floating point exception
    
    Error at Node 4: floating point exception
    
    Error at Node 5: floating point exception
    
    Error at Node 6: floating point exception
    
    Error at Node 7: floating point exception
    
    Error at Node 8: floating point exception
    
    Error at Node 9: floating point exception
    
    Error at Node 10: floating point exception
    
    Error at Node 11: floating point exception
    
    Error at 
    Error at Node 13: floating point exception
    
    Error at Node 15: floating point exception
    N
    Error at Node 14: floating point exception
    ode 12: floating point exception
    
    Experiencing convergence difficulties - temporarily relaxing and trying again...
    
    Experiencing convergence difficulties - temporarily relaxing and trying again...
    
    Experiencing convergence difficulties - temporarily relaxing and trying again...
    
    Experiencing convergence difficulties - temporarily relaxing and trying again...
            Stabilizing pressure coupled to enhance linear solver robustness.
            Stabilizing pressure coupled using GMRES to enhance linear solver robustness.
    
    Experiencing convergence difficulties - temporarily relaxing and trying again...
    
    Divergence detected in AMG solver: pressure coupled        Stabilizing solution-species-0 to enhance linear solver robustness.
            Stabilizing solution-species-0 using GMRES to enhance linear solver robustness.
    
    Divergence detected in AMG solver: solution-species-0        Stabilizing solution-species-1 to enhance linear solver robustness.
            Stabilizing solution-species-1 using GMRES to enhance linear solver robustness.
    
    Divergence detected in AMG solver: solution-species-1 temperature limited to 1.000000e+00 in 273407 cells on zone 8407 in domain 2
             Stabilizing vof-1 to enhance linear solver robustness.
            Stabilizing vof-1 using GMRES to enhance linear solver robustness.
    
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Divergence detected in AMG solver: pressure coupled
    Divergence detected in AMG solver: solution-species-0
    Divergence detected in AMG solver: solution-species-1
    Divergence detected in AMG solver: vof-1
    Error at host: floating point exception
    
    Error: floating point exception
    Error Object: #f
    

    应该是UDF的问题,但不知道具体是什么问题。生长速率udf代码如下:

    #include "sg_mphase.h"
    DEFINE_PB_GROWTH_RATE(growth_rate,cell,thread,d_1)
    {
    	real G;/* growth rate in m/s*/
    	real Kg = 1.280e-5; /* growth rate constant */
    	real g = 1.947;/* primary nucleation law power index */
    	real x;/* the antisolvent proportion in kg-antisolvent/kg-antisolvent and solvent */
    	real y;/* the solubility in kg-solute/kg-antisolvent and solvent */
    	real C;/* the solute concentration in kg-solute/kg-solvent */
    	real Solubility;/* the solubility in kg-solute/kg-solvent */
    	real delta_C;/* the difference between the solute concentration and the solubility, kg-solute/kg-solvent */
    	real solute_mass_frac,solvent_mass_frac,antisolvent_mass_frac;
    
    	Thread *tc = THREAD_SUPER_THREAD(thread); /* obtain mixture thread */
    	Thread **pt = THREAD_SUB_THREADS(tc); /* pointer to sub_threads */
    	Thread *tp = pt[P_PHASE]; /* primary phase thread */
    
    	solute_mass_frac = C_YI(cell,tp,0);/* mass fraction of solute in primary phase (solvent,antisolvent,Paracetamol) */
    	solvent_mass_frac = C_YI(cell,tp,2);/* mass fraction of solvent in primary phase (solvent,antisolvent,Paracetamol ) */
    	antisolvent_mass_frac = 1.-solute_mass_frac-solvent_mass_frac;/* mass fraction of antisolvent in primary phase (solvent,antisolvent,Paracetamol) */
    
    	x = antisolvent_mass_frac/(antisolvent_mass_frac+solvent_mass_frac);/* the antisolvent proportion in kg-antisolvent/kg-antisolvent and solvent */
    	y = -2.63748*pow(x,4)+9.04654*pow(x,3)-10.86277*pow(x,2)+5.04399*x-0.57920;/* the solubility in kg-solute/kg-antisolvent and solvent */
    	Solubility = y*(1.+(antisolvent_mass_frac /solvent_mass_frac));/* the solubility in kg-solute/kg-solvent */
    	C = solute_mass_frac/solvent_mass_frac;/* the solute concentration in kg-solute/kg-solvent */
    	delta_C = C-Solubility; /* Definition of Supersaturation */
    
    	if (delta_C == 0.)
    	{
    		G = 0.;
    	}
    	else
    	{
    		G = Kg*pow(delta_C,g);
    	}
    	return G;
    }
    
    waltenW 1 条回复 最后回复
  • 推纱望月推 离线
    推纱望月推 离线
    推纱望月
    写于 最后由 编辑
    #2

    你的是并行计算挂载有问题,串行计算没有问题吗?

    1 条回复 最后回复
  • 西湖冷月西 离线
    西湖冷月西 离线
    西湖冷月
    写于 最后由 编辑
    #3

    看提示信息说的是浮点数溢出,没遇到过这种错误,期待UDF大佬现身说法:chouchou:

    努力守恒。

    1 条回复 最后回复
  • 推纱望月推 离线
    推纱望月推 离线
    推纱望月
    写于 最后由 编辑
    #4

    你检查一下UDF里的参数

    1 条回复 最后回复
  • waltenW 离线
    waltenW 离线
    walten
    在 中回复了 关伯兰在笑 最后由 编辑
    #5

    @关伯兰在笑 逐行排查吧,所有分母都添加一个很小的量。

    1 条回复 最后回复

  • 登录

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