|
[Sponsors] |
code is being executed more than once per time step with different values |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 18, 2015, 10:36 |
code is being executed more than once per time step with different values
|
#1 |
New Member
Jinming Wu
Join Date: Oct 2015
Posts: 3
Rep Power: 11 |
When performing Fluent transient simulation, I encountered the problem that the Message script (with subscript) is excuted more than once in every time step, and the variable value is different every time. Does anyone know why is this happen.
The script is shown below, and the result is shown in Fig1. Thank you for your help! #include "udf.h" real cvelocity[3]={0,0,0}; real rotcentroid[3]={150,0,0}; real m1=5736; DEFINE_CG_MOTION(T1,dt,vel,omega,time,dtime) { Thread *thread; Domain *domain; real force[3]={0,0,0}; real moment[3]={0,0,0}; NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); if(!Data_Valid_P()) return; domain=Get_Domain(1); thread=Lookup_Thread(domain,4); Compute_Force_And_Moment(domain,thread,rotcentroid ,force,moment,TRUE); cvelocity[0]+=dtime*(force[0]/m1); cvelocity[1]+=dtime*((force[1]-m1*9.81)/m1); vel[0]=cvelocity[0]; vel[1]=cvelocity[1]; Message("\nvel[0] equals %f\n",cvelocity[0]); } |
|
November 19, 2015, 04:20 |
|
#2 |
New Member
Jinming Wu
Join Date: Oct 2015
Posts: 3
Rep Power: 11 |
Does anyone know how tho solve this problem?
|
|
Tags |
define_cg_motion, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 14:40 |
pimpleFoam: turbulence->correct(); is not executed when using residualControl | hfs | OpenFOAM Running, Solving & CFD | 3 | October 29, 2013 09:35 |
same geometry,structured and unstructured mesh,different behaviour. | sharonyue | OpenFOAM Running, Solving & CFD | 13 | January 2, 2013 23:40 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 08:56 |
calculation diverge after continue to run | zhajingjing | OpenFOAM | 0 | April 28, 2010 05:35 |