-
-
October 31, 2023 at 4:43 pm
Ramesh Chandra Mishra
SubscriberHi
I am writing a UDF to specify the source term but not using any zone ID, rather I am using co-ordinates of the zone in my code which is as follows:
DEFINE_SOURCE(Pollutant_3, c, t, dS, eqn){real x[ND_ND];real source;C_CENTROID(x, c, t);Âif (x[0] >= 111.0 && x[0] <= 123.0 && x[1] >= 0.0 && x[1] <= 0.45 && x[2] >= 90.0 && x[2] <= 126.0) //Modify the release source mzhang{source = NO2;}else{source = 0;}ÂdS[eqn] = 0;return source;}So do I need to mention about the same in my GUI too and if yes where, because i dont have a zone where i can specify these details. -
October 31, 2023 at 5:08 pm
Rob
Forum ModeratorYou still need to hook the UDF into the cell zone(s), it's covered in the manual. I'm assuming NO2 is defined somewhere?Â
As a more general comment, if source is REAL define it as 0.0Â Â It shouldn't cause any problems but is something I've always been pulled up on.Â
-
November 1, 2023 at 4:15 am
Ramesh Chandra Mishra
SubscriberHi Rob
Just want to confirm if you are saying I should initialize source to 0.
Secondly, my initial query , I don't have a cell zone in my mesh, that is the reason I was defining it in UDF. If you say that hooking UDF is mandatory, so I am thinking of creating a region and then initialize and patch the user defined source. Will that work? I mean will it take the patched pollutant as the source term?
-
November 1, 2023 at 5:17 am
Ramesh Chandra Mishra
SubscriberRob
Apart from the above query, I am facing one more issue. I need to run this simulation on a cluster. So how will this patching work? Because UDF compilation has to be done on a cluster. And without compiling and initializing , I can't patch the source to the region. Can we do it through TUI commands in journal file.
If yes, can you please let me know the commands.
-
November 1, 2023 at 10:29 am
Rob
Forum ModeratorA source term is a continuous addition (or removal) of something from a cell zone in the model. A patch is a one off value added (typically) at the beginning of the run.Â
If there is no cell zone you can't interact with it as there isn't anything to interact with - Fluent needs the mesh to know there's something there!Â
-
- The topic ‘Define source term in udf without using zone ID’ is closed to new replies.
-
3572
-
1188
-
1076
-
1063
-
952
© 2025 Copyright ANSYS, Inc. All rights reserved.