|
[Sponsors] |
June 17, 2020, 12:00 |
Looping Profile in UDF
|
#1 |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
Hi,,
I am trying to create a temperature profile for the wall using the tutorial. The profile using a formula to define the temperature. The formula has a constant whose value I need to change . So is possible to create a loop of temperature profile for each different value of the constant? For eg- I save the constants in array named A= [ 100 200 300 400 500]. So is possible to create a loop for defining the UDf of temperature_profile_x where for a particular value of x it takes constant from array. So if I give i goes from 1 to 5, it should create 5 temperature profile using the 5 different constants values from the array. Thank you. |
|
June 17, 2020, 12:23 |
Loop
|
#2 |
Senior Member
|
What is the basis for changing the value? Is it different for different boundaries, or does it depend on time or some other parameter? On what basis should the function choose 2nd or 3rd value instead of 1st or 4th?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 17, 2020, 12:28 |
|
#3 | |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
Quote:
I want to run the simulations for all the cases. The temperature profile is to be applied on the same wall everytime just the value of the above mentioned constant should change.For each constant i want to create a temperature profile and then for each temperature profile I want to run the simulations. The idea is to take a .csv file, read the data from it. Store the data in an array. And for each value from the array create a temperature_profile and run the simulation for each case. Constant here is from the sinusoidal temperature on the 2D wall of the channel. |
||
June 17, 2020, 12:43 |
Udf
|
#4 |
Senior Member
|
Then an array is not a proper approach. Use Input Parameter instead.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 17, 2020, 15:35 |
|
#5 |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
Okay. But how will I read a .csv file data in input parameter?
|
|
June 17, 2020, 16:07 |
Reading from File
|
#6 |
Senior Member
|
If you are using Fluent standalone, then a good approach is to define a scheme variable (an rpvar) that represents the value of this parameter. The value can be changed either via command within the journal file or using a scheme list. UDF can read the value of this rpvar and do the calculation accordingly.
If you are using WB, then there is direct option to use Excel within WB, which can read a csv file for input parameters.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 18, 2020, 14:34 |
|
#7 |
New Member
Join Date: Apr 2018
Posts: 2
Rep Power: 0 |
Use parametric analysis
|
|
June 18, 2020, 15:38 |
|
#8 |
Member
George Corner
Join Date: Dec 2016
Posts: 30
Rep Power: 10 |
Hi,
I want to measure particle velocity in a fluidized bed using UDF. I am using Transient mode to see how particle velocity changes in every time step. My question is how I command to UDF in order to determine velocity in each time step. |
|
June 18, 2020, 15:45 |
Model
|
#9 |
Senior Member
|
It depends on the model being used for particles. Is it Lagrangian or Eulerian? You don't need UDF for any of these. For Lagrangian, you can enable Sampling and then run the simulation. For Eulerian, just write ASCII files with granular phase velocity components or magnitude at each cell.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 18, 2020, 16:02 |
|
#10 | |
Member
George Corner
Join Date: Dec 2016
Posts: 30
Rep Power: 10 |
Quote:
#include "udf.h" DEFINE_EXCHANGE_PROPERTY(user_velo,cell,mix_thread ,s_col,f_col) { Thread *thread_g, *thread_s; /*face_t f; real t=CURRENT_TIMESTEP;*/ real x_vel_s, y_vel_s, z_vel_s; thread_g = THREAD_SUB_THREAD(mix_thread, f_col);/* gas phase */ thread_s = THREAD_SUB_THREAD(mix_thread, s_col);/* solid phase*/ x_vel_s = C_U(cell, thread_s); y_vel_s = C_V(cell, thread_s); z_vel_s = C_W(cell, thread_s); /* return x_vel_s return y_vel_s return z_vel_s */ } DEFINE_PROPERTY(user_gran_temp,c,t) { real gran_temp; real x_vel_s; real y_vel_s; real z_vel_s; gran_temp=(x_vel_s*x_vel_s+y_vel_s*y_vel_s+z_vel_s *z_vel_s)/3; return gran_temp; } |
||
June 19, 2020, 06:37 |
UDFs
|
#11 |
Senior Member
|
Both of the UDFs are not doing anything. If you want Granular Temperature, you do not need UDF. Just go to File > Export > During Solution, select ASCII and Granular Temperature under appropriate headings, and chose frequency for writing.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 19, 2020, 13:50 |
|
#12 | |
New Member
Manish Vankudre
Join Date: Feb 2020
Posts: 15
Rep Power: 6 |
Quote:
|
||
Tags |
fluent, udf and programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
please help UDF for velocity profile in y-directio | raju | Fluent UDF and Scheme Programming | 6 | April 13, 2019 00:21 |
UDF Parabolic 2D Velocity Profile Issue | chrislyn | FLUENT | 2 | December 11, 2018 13:11 |
UDF inlet velocity profile mismatch with Fluent | ChristineL | Fluent UDF and Scheme Programming | 15 | November 25, 2016 07:45 |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
Read profile file from UDF | DonQuijote | Fluent UDF and Scheme Programming | 0 | February 18, 2013 12:56 |