|
[Sponsors] |
Pass data from DEFINE_AT_END to DEFINFE_PROFILE by UDM(or C_YI(c,t,i)) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 8, 2020, 22:18 |
Pass data from DEFINE_AT_END to DEFINFE_PROFILE by UDM(or C_YI(c,t,i))
|
#1 |
New Member
John mayer
Join Date: Jun 2020
Posts: 3
Rep Power: 6 |
Hello everyone,
I wrote a UDF that calculates the heat flux in DEFINE_AT_END and stores it in UDM(or C_YI(c,t,i)) in a Eulerian model. Then gets the UDM(or C_YI(c,t,i)) in DEFINFE_PROFILE and calculates. However, the DENINFE_PROFILE doesn't get the data from UDM, and receives a fatal signal while the C_YI(c,t,i) was used to stores datas. I had a test in a single-phase model with C_YI(c,t,i), and it works well. Thanks for any suggestion, John mayer |
|
June 8, 2020, 22:25 |
|
#2 | |
New Member
John mayer
Join Date: Jun 2020
Posts: 3
Rep Power: 6 |
Quote:
#include "udf.h" #include "mem.h" int ID=15; int sum=0.; int cc=0.; DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *d; Thread *t; face_t f; cell_t c; real h; real q; real dt=1.; real k=1.2; real cc2; Thread *t_steel; d = Get_Domain(2); thread_loop_c (t,d) { t_steel=THREAD_SUB_THREAD(t,S_PHASE); begin_c_loop (c,t) { C_YI(c,t,0)=1/C_UDMI(c,t,0); } end_c_loop (c,t) } } DEFINE_PROFILE(up_flux_profile,t,i) { Domain *d; face_t f; cell_t c; real h; real x[ND_ND]; real k=1.2; real q; real dt=1.; Thread *t_steel; t_steel=THREAD_SUB_THREAD(t,P_PHASE); begin_c_loop(c,t) { C_PROFILE(c,t,i)=C_YI(c,t,0); } end_c_loop(c,t) } Last edited by John mayer; June 8, 2020 at 22:42. Reason: something is wrong |
||
June 9, 2020, 02:19 |
|
#3 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you code can't work
do you calculate heat flux (flux through boundary) or heat source (heat, applied to volume) ? Code:
C_YI(c,t,0)=1/C_UDMI(c,t,0); why do you use DEFINE_EXECUTE_AT_END but not DEFINE_ADJUST ?
__________________
best regards ****************************** press LIKE if this message was helpful |
|
June 9, 2020, 03:18 |
|
#4 | |
New Member
John mayer
Join Date: Jun 2020
Posts: 3
Rep Power: 6 |
Quote:
|
||
June 9, 2020, 23:13 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
how many questions can you see in my previous message?
__________________
best regards ****************************** press LIKE if this message was helpful |
|
June 15, 2020, 05:16 |
C_yi
|
#6 |
Senior Member
|
That's incorrect usage of C_YI. C_YI is not a generic memory like C_UDM. It stores mass fractions of species and is available only if species transport is enabled. And if that is the case, then Fluent will overwrite C_YI values based on the solution of species transport. So, do not use C_YI the way you are using it. You can use more than one UDM though.
And then, you need to store something in UDM before using it. The code does not store any value in UDM. Furthermore, you don't need two functions. You can do all the calculation within DEFINE_PROFILE.
__________________
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. |
|
Tags |
udm; udf; profile; |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] How to get the coordinates of velocity data at all cells and at all times | vidyadhar | ParaView | 9 | May 20, 2020 21:06 |
Data Produced From Fine Marine Cant Match with The Experimental Data | PeiSan | Fidelity CFD | 4 | August 23, 2014 06:33 |
Problem running in parralel | Val | OpenFOAM Running, Solving & CFD | 1 | June 12, 2014 03:47 |
[OpenFOAM] saving data in paraview | aylalisa | ParaView | 3 | May 31, 2014 12:38 |
[General] Warping Cells by Vectors? | ronwelty | ParaView | 10 | April 29, 2014 06:52 |