|
[Sponsors] |
March 22, 2018, 06:15 |
How to calculate cell area??
|
#1 |
New Member
Satyam
Join Date: Jun 2017
Posts: 7
Rep Power: 9 |
Hi Everyone,
I am writing UDF for Energy source term in axis-symmetric case which is varying for every cell in the zone thread.I need to multiply area of that cell to corresponding cell energy source term. please tell me how can I find Area for each cell in axis symmetric case ? |
|
September 9, 2021, 23:04 |
|
#2 |
New Member
Amitav tikadar
Join Date: Jul 2017
Location: Atlanta
Posts: 14
Rep Power: 9 |
Hi. I am just wondering did you figure out how to get each cell surface area? I also need to calculate each cell surface area to apply an energy source term.
TIA |
|
September 13, 2021, 01:58 |
|
#3 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
look for macro
Code:
F_AREA(A,f,t);
__________________
best regards ****************************** press LIKE if this message was helpful |
|
September 14, 2021, 03:40 |
|
#4 |
New Member
Amitav tikadar
Join Date: Jul 2017
Location: Atlanta
Posts: 14
Rep Power: 9 |
Thanks for the reply.
I have tried F_AREA(A,f,t) to calculate each cell surface area inside DEFINE_SOURCE macro and got an error. It seems like DEFINE_SOURCE macro is for cell whereas F_AREA(A,f,t) is for face. Should I need to use any face loop inside DEFINE_SOURCE macro to get each cell surface area? My intended source term is like = Surface_area_of_cell * T_cell / Cell_volume |
|
September 14, 2021, 07:37 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
I have no idea, what exactly you need.
this code make a loop over faces of each boundary and calculates source according to your condition for the first row of cells adjusted to that boundaries Code:
#include "udf.h" DEFINE_ADJUST(my_adjust,d) { cell_t c0; Thread *t,*t0; face_t f; real A[ND_ND],source; thread_loop_f(t,d) { begin_f_loop(f,t) { if (BOUNDARY_FACE_THREAD_P(t)) { c0 = F_C0(f,t); t0 = THREAD_T0(t); F_AREA(A, f, t); source = A*C_T(c0,t0)/C_VOLUME(c0,t0); C_UDMI(c0,t0,0) = source; } } end_f_loop(f,t) } } DEFINE_SOURCE(my_source,c,t) { return C_UDMI(c,t,0); }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
September 14, 2021, 13:59 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
It makes no sense to use the cell surface area in your source, because it is mesh dependent. Your source would depend on the mesh, a finer mesh gives a higher source.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
September 14, 2021, 14:09 |
|
#7 |
New Member
Amitav tikadar
Join Date: Jul 2017
Location: Atlanta
Posts: 14
Rep Power: 9 |
Thanks for raising an important question that I didn't consider before. My source term is spatial cell temperature dependent via 'Source = h * A * T' equation. Is there any way I can avoid cell surface area in the source term since temperature would be different in each cell?
|
|
September 14, 2021, 14:15 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Which psysical equation for source are you trying to model? The psysical equation should only have physical things, like temperature, material properties, physical lengths... Not mesh sizes, they are not physical.
(i don't understand your worry about different temperatures, there is nothing problematic about that.)
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
September 14, 2021, 14:25 |
|
#9 |
New Member
Amitav tikadar
Join Date: Jul 2017
Location: Atlanta
Posts: 14
Rep Power: 9 |
I am trying to model only the Energy equation. So, I should use the total surface area of the domain (that is a known geometrical parameter) instead of the cell surface area (which is a mesh-dependent quantity)?
|
|
September 15, 2021, 01:29 |
|
#10 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
That is not what I mean.
You have a source. Describe that source with a physical equation. Until you do that, I have no idea if and how the source relates to an area. There are millions of ways to define a source, I have no idea which source is present in your problem. Source has units W/m3, so give me something that has units W/m3.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to calculate free-surface area in a computational cell | cfdstar | Fluent UDF and Scheme Programming | 6 | July 12, 2018 13:24 |
How to get face or cell a area in a DEFINE_SOURCE? | KiteKathy | FLUENT | 0 | March 22, 2017 06:26 |
How to use "translation" in solidBodyMotionFunction in OpenFOAM | rupesh_w | OpenFOAM Running, Solving & CFD | 5 | August 16, 2016 04:27 |
Storing Surface Area of each cell in a file? | Markus Alzon | FLUENT | 0 | June 21, 2007 08:38 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 04:41 |