|
[Sponsors] |
UDF for 3d boundary conditions problem in fluent |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
July 15, 2013, 11:14 |
UDF for 3d boundary conditions problem in fluent
|
#1 |
New Member
Pawan Hurnath
Join Date: Jun 2013
Posts: 5
Rep Power: 12 |
Hi, I am trying to use a udf to model the temperature jump across a data center rack. I TRIED IN 2D successfully and now I am trying to extend the result to 3d but to no avail.
The udf which worked for the 2d is shown below. I trid using the same of 3d /* udf for temperature jump across rack one*/ #include "udf.h" DEFINE_PROFILE(temperature, thread, index) { Domain *domain= Get_Domain(1); real x[ND_ND]; face_t f; int Zone_ID=8; Thread *t0=Lookup_Thread(domain,Zone_ID); begin_f_loop(f,thread) { F_CENTROID(x,f,thread); F_PROFILE(f,thread,index) =(F_T(f,t0)+3); } end_f_loop(f,thread) } I do not kno what changes do I need to bring to the udf to change in th 3d. Initially I though that I should try looping over cells instead of looping over faces? Any help ? what do you think? quite urgent! please some one help me out |
|
July 15, 2013, 20:11 |
|
#2 |
Senior Member
|
I do not know why this code works for 2D. Do the threads "t0" and "thread" have the same shape and same number of faces? You want the temperature jump between those two threads be 3K? You need to build a mapping between those two threads.
|
|
July 15, 2013, 23:22 |
|
#3 |
New Member
Pawan Hurnath
Join Date: Jun 2013
Posts: 5
Rep Power: 12 |
Yeah I want the temp jump to be 3k. What's a thread mapping and how do I do it?
|
|
July 16, 2013, 09:00 |
|
#4 |
New Member
Pawan Hurnath
Join Date: Jun 2013
Posts: 5
Rep Power: 12 |
This is sthe error I receive:
Received signal 1 [time 7/16/13 13:6:29] 1000000: /opt/ansys/v140/fluent/fluent14.0.0/lnamd64/3ddp/fluent.14.0.0 [0x14f6c44] 1000000: /opt/ansys/v140/fluent/fluent14.0.0/lnamd64/3ddp/fluent.14.0.0 [0x14f72e3] 1000000: /lib64/libpthread.so.0 [0x2b435edf9ca0] 1000000: libudf/lnamd64/3ddp/libudf.so(temperature+0x55) [0x2b4363f4c3c9] Error [client] [time 7/16/13 13:6:29] fluent.14.0.0 received a fatal signal (SEGMENTATION VIOLATION). 999999: /opt/ansys/v140/fluent/fluent14.0.0/lnamd64/3ddp/fluent.14.0.0(CX_Primitive_Error+0x1f7) [0x14f7117] 999999: /opt/ansys/v140/fluent/fluent14.0.0/lnamd64/3ddp/fluent.14.0.0 [0x14f732f] 999999: /lib64/libpthread.so.0 [0x2b435edf9ca0] 999999: libudf/lnamd64/3ddp/libudf.so(temperature+0x55) [0x2b4363f4c3c9] |
|
July 16, 2013, 14:29 |
UDF for boundary condition
|
#5 |
New Member
Bill Wangard
Join Date: Jan 2011
Posts: 21
Rep Power: 0 |
This will most likely NOT work.
Why? because the face thread passed TO the DEFINE_PROFILE, "thread", is not the same thread as "t0". Thus, they will have different face counts. And, since fluent meshes are unstructured, there is no way to correspond the faces on Thread "t0" with Thread "thread". A better way to do this is to perform a DEFINE_ADJUST to compute the face average of "t0", then to apply the average to "thread" in the profile. |
|
July 16, 2013, 14:54 |
|
#6 |
New Member
Pawan Hurnath
Join Date: Jun 2013
Posts: 5
Rep Power: 12 |
Will this resolve the segmentation violation issue as well?
|
|
July 16, 2013, 16:27 |
|
#7 |
New Member
Bill Wangard
Join Date: Jan 2011
Posts: 21
Rep Power: 0 |
The threads are different sizes (probably) thus the face loop will access bogus data.
|
|
July 17, 2013, 10:31 |
|
#8 |
New Member
Pawan Hurnath
Join Date: Jun 2013
Posts: 5
Rep Power: 12 |
Do you think i can use the F_PROFILE macro in conjunction within with DEFINE_ADJUST instead of DEFINE_PROFILE
|
|
July 19, 2013, 14:27 |
|
#9 |
New Member
Bill Wangard
Join Date: Jan 2011
Posts: 21
Rep Power: 0 |
Exactly! And just in case you were going to parallelize your code, remember DEFINE_PROFILE is NEVER called from the HOST node. It is only called from the compute nodes.
Thus, it is a bad idea to have something like this Code:
DEFINE_PROFILE(myprofile,t,i) { int ID = <some number> val = integrate_something_on_another_thread(ID); begin_f_loop(f,t) F_PROFILE(f,t,i) = val; end_f_loop(f,t); } real integrate_something_on_another_thread(int id) { Thread*t = Lookup_Thread(Get_Domain(1), id); #if !RP_NODE do stuff #else do more stuff #endif } Again what you said is correct, you want to embed the call to "do stuff on the other thread" within a DEFINE_ADJUST function. Hope this helps. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 58 | July 3, 2020 01:13 |
Boundary Conditions problem | o_mars_2010 | Main CFD Forum | 2 | July 8, 2013 02:10 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 06:28 |
Problem with periodic boundary conditions | jm_ngs | FLUENT | 7 | April 27, 2012 02:32 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 10:56 |