|
[Sponsors] |
May 9, 2019, 09:42 |
How to use patch under loading UDF?
|
#1 |
New Member
lili
Join Date: May 2019
Posts: 12
Rep Power: 7 |
Hi, I'm trying to make UDF for changing heat generation rate at the boundary between solid phase and liquid phase. In addition to it, I want to set temperature 300K at solid phase and 550K at liquid phase. My UDF could be compiled and be loaded but if this UDF is loaded at the boundary, I can't change the temperature using patch at initialization setting. (I can initialize without patch.)
This is the error when I try to use patch: ================================================== ============ Node 0: Process 6392: Received signal SIGSEGV. ================================================== ============ MPI Application rank 0 exited before MPI_Finalize() with status 2 The fl process could not be started. What should I do to use patch setting under loading UDF at the boundary between liquid and solid phases? |
|
May 9, 2019, 23:51 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
what do you mean under heat generation rate at the boundary
it is applied to volume not boundary. you should attach your udf here and explain in details each your step before you get the error, if you want to get help best regards |
|
May 15, 2019, 06:09 |
|
#3 |
New Member
lili
Join Date: May 2019
Posts: 12
Rep Power: 7 |
Thank you for replying. Sorry I cannot attach all of my UDF but my UDF is like this,
#include "udf.h" #include "unsteady.h" #include "mem.h" DEFINE_PROFILE(heat_profile, thread, i) { cell_t c; Thread *c_thread; real dt = CURRENT_TIMESTEP; begin_c_loop(c, c_thread, i) { real c_volume = C_VOLUME(c, c_thread); real dT = C_T_M1(c, c_thread); . . . F_PROFILE(c, c_thread, i) = (some values* c_volume/dt)*dT; } end_c_loop(c, c_thread) } I attached this UDF at the wall between fluid phase and liquid phase. I could compile and load this UDF but if I initialize and use patch, that error is occurred. |
|
May 15, 2019, 23:13 |
|
#4 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" #include "unsteady.h" #include "mem.h" DEFINE_PROFILE(heat_profile, thread, i) { cell_t c; real dt = CURRENT_TIMESTEP; begin_c_loop(c, c_thread, i) { real c_volume = C_VOLUME(c, thread); real dT = C_T_M1(c, thread); . . . F_PROFILE(c, thread, i) = (some values* c_volume/dt)*dT; } end_c_loop(c, thread) } Quote:
|
||
May 17, 2019, 04:31 |
|
#5 |
New Member
lili
Join Date: May 2019
Posts: 12
Rep Power: 7 |
AlexanderZ,
Thank you for replying. I tried to define the temperature for the first time step but it doesn't work. You told me that I need to define UDS for C_T_M1 but I don't know how to define it. Should I write the UDF for UDS to get C_T_M1 or just set UDS in fluent? regards |
|
Tags |
fluent, patch by zone, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
chtMultiRegionFoam Tutorial | m.nichols19 | OpenFOAM | 12 | September 9, 2010 12:56 |
[Other] StarToFoam error | Kart | OpenFOAM Meshing & Mesh Conversion | 1 | February 4, 2010 05:38 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |