|
[Sponsors] |
Boundary condition from information of other boundary surface |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 27, 2020, 09:27 |
Boundary condition from information of other boundary surface
|
#1 |
New Member
ShOh
Join Date: Jul 2020
Posts: 12
Rep Power: 6 |
Hello. I would really appreciate if you could give me an answer.
I'd like to apply a boundary condition so that the UDS of the present surface is 10% of the sum of UDS of the other surface of which id is 7. Here is my udf code. ------------------------------------------- #include "udf.h" #define idoutlet 7 DEFINE_PROFILE(udf_filter,t,i) { real sumudf; face_t f; sumudf=0; begin_f_loop(f,idoutlet) { sumudf+=F_UDSI(f,idoutlet,0); } end_f_loop(f,idoutlet) begin_f_loop(f,t) { F_PROFILE(f,t,i)=sumudf*0.1; } end_f_loop(f,t) } ------------------------------------------- But, when the calculation starts, the solver stops and the program is shut down. Could you tell me where is the problem in my code? |
|
July 28, 2020, 02:26 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" #define idoutlet 7 real sumudf; DEFINE_PROFILE(udf_filter,t,i) { face_t f; begin_f_loop(f,t) { F_PROFILE(f,t,i)=sumudf*0.1; } end_f_loop(f,t) } DEFINE_ADJUST(surf_avg,d) { Thread *t; face_t f; t = Lookup_Thread(d,idoutlet); sumudf=0.0; thread_loop_f(t,d) { begin_f_loop(f,t) { sumudf+=F_UDSI(f,t,0); } end_f_loop(f,t) } # if RP_NODE sumudf = PRF_GRSUM1(sumudf); # endif Message0("**** sumudf = %f ****\n",sumudf); }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
CFD analaysis of Pelton turbine | amodpanthee | CFX | 31 | April 19, 2018 19:02 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
several fields modified by single boundary condition | schröder | OpenFOAM Programming & Development | 3 | April 21, 2015 06:09 |
External Radiation Boundary Condition (Two sided wall), Grid Interface | CFD XUE | FLUENT | 0 | July 8, 2010 07:49 |