-
-
December 15, 2021 at 2:45 pm
Ales23
SubscriberDear all,
I am trying to parallelize my calculation. However, I am facing a problem with a cell macro:
I have following code:
begin_c_loop_int(c,t)
{
Message("%e ",C_VOLUME(c,t));
}
end_c_loop_int(c,t)
For this simple code the simulation crashes. If I want to display C_P(c,t), it works.
Important note: It is 2D simulation.
Thank you for your help
December 21, 2021 at 1:20 pmKarthik R
AdministratorHello Can you please try running a script from the Fluent customization manual to make sure this is not a systems-related issue? Also, what is the objective of your UDF?
Karthik
December 21, 2021 at 2:26 pmAles23
Subscriberthank you. in the end I found the error. I excess a wrong thread
December 22, 2021 at 2:04 pmKarthik R
AdministratorAwesome! Good luck with your projects.
February 25, 2022 at 8:40 amalexandra17
SubscriberHi! I kind of have the same issue here and I do not think it relates with the thread. Every time I introduce the macro C_VOLUME my code crashes. I need to determine the volume of each cell in order to calculate the partial pressure. I have a one phase mixing model with two species air and water vapors. I narrowed down my code to this C_Volume thing because it refuses to work. Every time I insert this I get the sigsegv error. Does anyone has any idea what I am missing here pretty please?
#include "udf.h"
#include "mem.h"
DEFINE_ON_DEMAND(mass)
{
Domain *d = Get_Domain(1);
Thread *t;
cell_t c;
real vol;
begin_c_loop(c,t)
{
vol = C_VOLUME(c,t);
Message("%e\n", vol);
}
end_c_loop(c,t)
}
February 25, 2022 at 8:43 amAles23
Subscriberyou are not assigning a thread. You have only declared add t=Lookup_Thread(ID,d);
ID is equal to the domain zone
February 25, 2022 at 10:30 amalexandra17
SubscriberHi Ales23! Thank you for your response! I've done that already as I am interested in a certain zone in my domain. The error remains the same. :(
February 25, 2022 at 10:33 amalexandra17
SubscriberI have checked to make sure the ID number corresponds to the zone I want and it does. The code I created works fine as long as I do not introduce the C_VOLUME macro.
February 25, 2022 at 11:18 amAles23
Subscriberbut in your code t=Lookup_Thread() is missing as I can see
February 25, 2022 at 12:45 pmalexandra17
SubscriberI attach my code with the Lookup_thread that I missed. The error remains the same. The ID number is fine. I have checked it already.
#include "udf.h"
#include "mem.h"
DEFINE_ON_DEMAND(mass)
{
Domain *d = Get_Domain(1);
Thread *t;
int ID = 5;
t = Lookup_Thread(d, ID);
cell_t c;
real vol;
begin_c_loop(c,t)
{
vol = C_VOLUME(c,t);
Message("%e\n", vol);
}
end_c_loop(c,t)
}
February 25, 2022 at 1:09 pmAles23
Subscriberare you using interior ID or cell zone condition?
February 25, 2022 at 3:45 pmalexandra17
SubscriberI am using the ID from a Boundary Condition, I guess that means that is interior ID right?
February 25, 2022 at 3:47 pmAles23
Subscriberyou have to use the one from Cell conditions
February 25, 2022 at 4:43 pmalexandra17
SubscriberOh I see! Thank you very much! It works fine now. However, this is not what I intended. Could you please tell me how to determine the cell volumes for a certain boundary area? I need to calculate the condensation rate on a window in a room.
February 28, 2022 at 4:52 pmRob
Ansys EmployeeHave a look for the adjacent cells, https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v221/en/flu_udf/flu_udf_ConnectivityMacros.html%23flu_udf_macros_f_c0_c1 is a good starting point.
Viewing 14 reply threads- You must be logged in to reply to this topic.
Ansys Innovation SpaceEarth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
Trending discussions- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
Top Contributors-
2656
-
2120
-
1349
-
1118
-
461
Top Rated Tags© 2023 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-