TAGGED: couple, fluent, transient, udf, udf-fluent
-
-
February 1, 2021 at 4:35 pm
ag1991
SubscriberHi,nI am conducting a TRANSIENT simulation where the usage of COUPLED SOLVER is mandatory, as the mesh is an overset one.nThe point is, I need to perform some computations within a UDF file which includes the so called DEFINE_PROFILE macro, which is actually adressed to a certain boundary whose static pressure is prescribed. In other words, I need the solver, for each time step, to compute every inner iteration this DEFINE_PROFILE macro, as it will calculate a newer value for static pressure on that boundary.nHowever, I have started seeing how wrong things are happening, for instance, I have included a 'counter' variable within this DEFINE_PROFILE macro which should be incremented by one for every iteration within the time step. Unfortunately, this counter only takes value of 1, rather than the actual number of iterations.nI would then like to ask you if while using COUPLED SOLVER, the DEFINE_PROFILE macro is only computed once before starting the P-V coupling iterative loop. I have tested this same UDF on a SEGREGATED SOLVER (SIMPLE) and it worked fine, with the counter taking the total number of iterations. According to Fluent UDF Guide the sequential algorithm should be the same for these two solvers but I would like someone to confirm me this.nnThanks.n -
February 2, 2021 at 2:07 am
YasserSelima
SubscriberDefine profile is called once every time step. If you want to call it every iteration, use Define_ADJUST macro. nDefine Adjust macro is called every iteration. And you can recall the function by its name from there .. nHowever, I do not recommend updating the profile every timestep. The solution will not be stable and probably it will not converge.n -
February 2, 2021 at 8:44 am
ag1991
SubscriberThanks for your response, YasserSelima. So, to sum up, let us say that COUPLED SOLVER only calls once the DEFINE_PROFILE macro per each time step whilst the SEGREGATED SOLVER does it every inner iteration within the time step? Am I right?nThe problem is, if I use DEFINE_ADJUST in order to actually call it every inner iteration, as you proposed, there is no possible prescription of pressure for the concerned boundary face. As far as I am concerned, DEFINE_PROFILE is the only macro capable to assign a certain value to all cells from a certain boundary thread. On top of that, in Fluent's GUI, you will see how you must select the DEFINE_PROFILE macro that is created specifically for that boundary on bondary conditions settings-->pressure outlet; whilst DEFINE_ADJUST is simply hooked without any assignment at all, hence leaving that pressure outlet value on bondary conditions settings-->pressure outlet with its default 0 Pa constant value (which ultimately will yield a prescribed 0 Pa pressure on that boundary).nFurthermore, as I conducted this same simulation (without an overset mesh) through the usage of SEGREGATED SOLVER (Simple) I could see how it converged satisfactorily, changing every inner iteration the pressure value according to my DEFINE_PROFILE macro, I believe if the URF are well posed and the expected pressure changes are not too large the simulation can indeed converge well.nAny other ideas?nRegardsnn -
February 2, 2021 at 12:20 pm
Rob
Ansys EmployeeDEFINE_PROFILE should be updated at the beginning of the time step, if the profile changes during the time step it could cause the solver to fail. The question then is, why do you need to change the profile within a time step? nModels that work without and don't work with overset tend to be down to the overset mesh, and checking for orphan cells is a good starting point. Looking at the flow just before divergence is also a good trick for identifying problem areas. n -
February 2, 2021 at 3:23 pm
ag1991
SubscriberHi Rob, I need to change the pressure profile within the time step because it depends on the current flowrate value through that outlet, it is a kind of 'resistance boundary condition'. I know this could seem unstable from a numerical viewpoint but hopefully, the numerical solver will converge to a certain solution after 20-30 inner iterations. In this way, it is possible to see how the pressure update on that boundary undergoes almost no changes once the solution is definetly convering (from 20th iteration on). All this can be observed in a segregated solver simulation without the usage of an overset mesh.nAnyway, I would like also to post here a picture from the iterative algorithm used on ANSYS FLUENT for both solvers, as you'll se, theoretically, DEFINE_PROFILE shall be updated every inner iteration. This is what actually makes me wonder what's happenning in there, since the same UDF code works perfectly with a segregated solver simulation.nn
-
February 2, 2021 at 3:53 pm
Rob
Ansys EmployeeChecknhttps://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v211/en/flu_udf/UDFx1-170002.9.htmlnSo, the profiles are called in the same way. Did you repeat the two runs without using overset? Note, PBCS may require the courant number to be altered as the default of 200 is fairly optimistic in many cases. n -
February 2, 2021 at 4:00 pm
DrAmine
Ansys EmployeeDEFINE_PROFILE as already mentioned gets updated at the top of every time step + every N iterations (Profile Update Interval). This is also mentioned in the documentation. So it gets updated every outer iteration. Can you verify on non-overset case (PS: Overset can be used with 21R1 with Segregated Solver).n -
February 2, 2021 at 7:38 pm
ag1991
SubscriberRob and DrAmine, I have just checked that I unconciously hit somehow the 'Update Interval' button and lowered it from 1 to 0. This was the reason for the profile to be updated every time step regardless of inner iterations.nThank you, it is also good to know ANSYS Fluent has also allowed the use of segregated solvers with overset mesh.n -
February 2, 2021 at 7:53 pm
YasserSelima
SubscriberHello ag1991,nEvery function could be recalled by its name inside the UDF. So, if you define a profile and called the function my_pressure_profile, you can call it from inside define adjust simply write my_pressure_profile();nJust note, to make sure it works right, you need to get the domain and get the thread by its id. -
February 2, 2021 at 9:55 pm
ag1991
SubscriberHello YasserSelima,nI didn't know that. This procedure might become handy for certain situations. That being said, I think if I called that function my_pressure_profile(...) from a DEFINE_ADJUST, entering as inputs of the function the domain and the boundary thread id, I am afraid that the value assigned to that boundary would be overwritten by the value you leave as default on Fluent GUI, under Boundary Conditions and Pressure Outlet.nRegardsn -
February 2, 2021 at 10:44 pm
YasserSelima
SubscriberIn your define profile above, you entered a thread ... ignore it.nIn the define profile function nd = Get_Domain(1);nth = LOOKUP_THREAD(d, thread_id);nThen assign your profile to the thread th ... thread_id is the id of this boundary, you can get it fro boundary conditions in the GUInnNow when you call this function from any function, it will assign profile to the thread th ... n
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth 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.
- 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
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5454
-
3409
-
2473
-
1310
-
1022
© 2023 Copyright ANSYS, Inc. All rights reserved.