|
[Sponsors] |
questions of nres and increase power per iteration |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 12, 2016, 14:09 |
questions of nres and increase power per iteration
|
#1 |
New Member
Join Date: Mar 2015
Posts: 13
Rep Power: 11 |
HI, all
I am trying to write a UDF to realize that it can increase the source power per 100 iterations. it is a steady calculation but I just want to increase the power. here is my udf: #include "udf.h" #include "sg_mphase.h" #define T_SAT 572.09 #define LAT_HT 1412.58e3 DEFINE_PROFILE(fixedwall_heatflux_01,thread,index) { real z[ND_ND]; real y; real q_avg; face_t f; int iter; real q; FILE *fp=fopen("qavg_01.txt","r"); fscanf(fp,"%f",&q_avg); fclose(fp); iter=nres; printf("%d\n",iter); if (iter<400) { q=q_avg; } else { q=q_avg+ceil((iter-400)/120.0)*22867.1; } begin_f_loop(f,thread) { F_CENTROID(z,f,thread); y=z[2]; if ((y>=0.07)&&(y<=2.07)) { F_PROFILE(f,thread,index)=(0.8187+0.6813*cos(2.*2. 4364*((y-0.07)/2.-0.5)))*q; } } end_f_loop(f,thread) } I found the question happened to nres which I want to use the current iteration. it can increase. but when it is higher than 1000, it change to 501 suddenly. i check online while they say it may have a limitation for NRES, but is anyone know how to turn off or change this limitation? |
|
August 28, 2018, 23:08 |
|
#2 |
New Member
Etienne Lin
Join Date: Aug 2017
Location: la Chine
Posts: 4
Rep Power: 8 |
i am using nres in my udf, but i don't understand its meaning, can you explain it?
thanks |
|
|
|