-
-
March 21, 2023 at 3:44 pm
bv169
SubscriberHello,
I found a UDF to calculate pressure on a face to move the mesh (dynamic mesh) based on this. The following is an exerpt from the UDF:
/* Get the value of the thread ID from a user-defined Scheme variable */
#if !RP_NODE /* SERIAL or HOST */
surface_thread_id = RP_Get_Integer("pres_av/thread-id");
Message("\nCalculating on Thread # %d\n",surface_thread_id);
#endif /* !RP_NODE *//* To set up this user Scheme variable in cortex type */
/* (rp-var-define 'pres_av/thread-id 6 'integer #f) */
/* After set up you can change it to another thread's ID using : */
/* (rpsetvar 'pres_av/thread-id 6) *//* Send the ID value to all the nodes */
host_to_node_int_1(surface_thread_id); /* Does nothing in serial */I have set my rp-var using a scheme file to the thread ID of the face I am looking to calculate on. When I run the simulation I only get the output ' Message("\nCalculating on Thread # %d\n",surface_thread_id);' and then error received sigsev. I am guessing after this line the UDF has an error, but I am lost on what to fix next.
Here is my scheme file if that helps:
(define (make-new-rpvar name default type)
(if (not (rp-var-object name))
(rp-var-define name default type #f)))
(rp-var-define 'pres_av/thread-id 6 'integer #f)(rpsetvar 'pres_av/thread-id 6)
Thanks,
Breanna -
March 22, 2023 at 10:08 am
Rob
Ansys EmployeeLooking at https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf_DataAccessMacros.html and https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf_sec_user_defined_scheme_var.html do you need that, or do you need the pressure on a surface to then do something?
The dynamic mesh example (reed valve) video might be useful? https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/prod_page.html?pn=Fluent&pid=Fluent&lang=en&prodver=23.1
-
March 30, 2023 at 7:07 pm
bv169
SubscriberMy udf calculates the average pressure on the face and then moves the face (Dynamic mesh) according to this pressure. I was using a serial UDF that was moving the mesh but it was calculating pressure wrong since it needed to be parallelized. I now am working with this parallelized UDF but the scheme variable is giving me issues. I tried to not use it and use a data access macro instead but still received errors.
-
March 31, 2023 at 9:06 am
Rob
Ansys EmployeeIf you know the surface ID that might be a better approach, that should replace the scheme? Otherwise, you've been running in parallel (architecture) as the true serial solver was removed a few versions back.
-
March 31, 2023 at 3:33 pm
bv169
SubscriberThanks. The UDF was working without error before trying to parallelize it. If its true that its running in parallel originally (without adding if !RP_NODE and !RP_HOST), then I can go back. The previous issue with that one was that it was outputting lots of pressure and force values in the console message, which made me think it needed to be parallelized since I was specifying a calculation of only the average pressure on the face, yet was receiving many outputs for one time step.
-
March 31, 2023 at 3:40 pm
Rob
Ansys EmployeeThe RP_HOST & RP_NODE are important as you increase the number of nodes, with default of one node it's less critical.
-
- 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
-
5290
-
3307
-
2469
-
1308
-
1016
© 2023 Copyright ANSYS, Inc. All rights reserved.