|
[Sponsors] |
How to update operating pressure using UDF DEFINE_ADJUST |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 26, 2020, 02:58 |
How to update operating pressure using UDF DEFINE_ADJUST
|
#1 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
Hello everyone,
I have written an UDF to update the operating pressure. I would like to know what should I do for operating pressure to be updated with the value of p_op_new. Is the below format right. Last edited by arunraj; June 26, 2020 at 07:23. |
|
June 26, 2020, 07:24 |
|
#2 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
I solved
RP_Set_Real("operating-pressure", p_op_new) /define/operating-conditions/operating-pressure (rpgetvar 'p_op_new) |
|
June 30, 2020, 12:05 |
|
#3 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
Hi
I have written a code by DEFINE_ADJUST for temperature jump as follows : DEFINE_ADJUST(temperaturejump3, domain) { Domain *d; int zone_ID = 16; Thread *f_thread = Lookup_Thread(domain, zone_ID); Thread *c_thread; cell_t cell; face_t face; double dTdy, temp, walltemp; double b = 0.000001; thread_loop_f (f_thread,domain) { begin_f_loop(face,f_thread) { cell = F_C0(face,f_thread); c_thread = THREAD_T0(f_thread); walltemp = F_T(face,f_thread); dTdy = C_T_G(cell,c_thread)[1]; F_PROFILE(face, f_thread, zone_ID) = (b*dTdy) + walltemp; } end_f_loop(face,f_thread) } } is it correct or does it need any modifying?? Thanks in advance |
|
June 30, 2020, 23:20 |
|
#4 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
Use 'message' in udf and check if your udf works. though it seems fine to me. I belive you can simply wirte
thread_loop_f (f,d) { begin_f_loop(f,t) } end_f_loop(f,t) Last edited by arunraj; July 1, 2020 at 06:17. |
|
July 1, 2020, 02:52 |
|
#5 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
thanks for your help but how could I use 'message'? could you be please more specific? and I had a problem that when I hooked DEFINE_ADJUST to hooked functions and start calculation, it says there is "SIGSEGV" error and closes the FLUENT immediately! what should I do? what is wrong with my code?
|
|
July 1, 2020, 02:55 |
|
#6 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
something like this can help. Inside f_loop
Message ("Text %g \n", var_name); |
|
July 1, 2020, 02:58 |
|
#7 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
okay thank you. and where should I put this line? inside f-loop or outside?
|
|
July 1, 2020, 03:14 |
|
#8 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
I got your message and thank you very much. but I think my condition is different with that in the UDF. I need to write a DEFINE_ADJUST for this:
T)f = T)s + b(dT/dy) in which T)f is fluid temperature and T)s is solid wall temperature and b is temperature jump coefficient and I also need to apply 'coupled' condition between the face and its shadow to maintain thermal conservation (the heat flux entering one is equal to heat flux exiting the other) |
|
July 1, 2020, 03:45 |
|
#9 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
Okay I understand. Take a sample udf from cfd online. search for it. modify it and use. As you are new, it is difficult to do directly. Mainly the format of UDF is important. Also, you need to explain the problem, How do I know if you are looking for which problem?
|
|
July 1, 2020, 04:13 |
|
#10 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
yes actually Im new with UDF coding so Im just looking for a DEFINE_ADJUST UDF template so I could modify it, I mean I need to know which arguments and expressions I have to write in my code for applying a temperature jump on a face. the temperature jump function is as follows :
T)f = T)s + b(dT/dy) in which T)f is fluid temperature and T)s is solid wall temperature and b is temperature jump coefficient |
|
July 1, 2020, 04:22 |
|
#11 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
You just repeated what you mentioned earlier. whats your problem and domain.
|
|
July 1, 2020, 04:27 |
|
#12 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
Im sorry I didnt understand before. Im simulating a heat-sink with rectangular michrochannel which have hydrophobic inside walls and water flowing through it, so I need to write a UDF for the temperature jump on liquid-solid interfaces (I have a slip flow on interfaces). can you please help me?
|
|
July 1, 2020, 04:38 |
|
#13 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
First search for some phd thesis and see if someone has already written udf for this. or of similar nature.
|
|
July 1, 2020, 04:40 |
|
#14 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
I have searched already but I didnt find any useful source. do you have any recommendation about where could I find some better Thesis? I mean an University website or something like that?!
|
|
July 1, 2020, 04:43 |
|
#15 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
I beleive you need to apply udf both on wall as well as shadow wall. So whatever udf i sent could be a reference. work on that improve that for your model.
|
|
July 1, 2020, 04:44 |
|
#16 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
okay thank you very much
|
|
July 1, 2020, 04:46 |
|
#17 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 207
Rep Power: 16 |
This could help you i guess
# include "udf.h2" DEFINE_ADJUST(match_boundary_at_end, d) { FILE *fp; Thread *tc1, *tc2; Thread *tf1, *tf2 ; cell_t c1, c2; face_t f1, f2; real f_c1[ND_ND], f_c2[ND_ND]; real dist; tf1 = Lookup_Thread(d,WALLSIDE1); tf2 = Lookup_Thread(d,WALLSIDE2); begin_f_loop(f1,tf1) { ----- } end_f_loop(f1,tf1) begin_f_loop(f2,tf2) { ---- } end_f_loop(f2,tf2) } |
|
July 1, 2020, 04:51 |
|
#18 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
yes I can use that as a template. thanks
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF to update Operating pressure | Rahul | Fluent UDF and Scheme Programming | 6 | June 26, 2020 05:54 |
A question on shared pressure in Cavitation UDF | dinhanh | Fluent UDF and Scheme Programming | 0 | May 3, 2018 07:33 |
the role of operating pressure in flow simulation | sunflower | FLUENT | 1 | December 20, 2010 22:24 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 06:13 |
Hydrostatic pressure in 2-phase flow modeling (long) | DS & HB | Main CFD Forum | 0 | January 8, 2000 16:00 |