-
-
November 22, 2017 at 11:23 am
Min Zhang
SubscriberIn the past two days, I performed a CFX simulation which called a fortran code to calculate an algebraic addition variable and a momentum source term simultaneously.
User Function: mom source(args)
If the Additional Variable (mom_add) is not set on the Fluid Models tab (just the momentum source is defined), the solver can finish normally. However, when mom_add is specified using the User Function mom source(args), an "solver-impi.exe" error is reported by CFX-Solver at the end of the run and no .res file is saved.
A similar problem is mentioned in CFD Online website, while it was unfortunately not solved.
https://www.cfd-online.com/Forums/cfx/126242-user-fortran-stack-overflow-problem.html
This situation occurs only if the addition variable is activated. So it is not caused by parallel setup (Intel MPI).
As I know relatively little about Fortran, I just thought this error is due to the USER_GETVAR routine which is applied to calculate velocity gradient tensor. Then i reviewed "USER CEL Example 2" in CFX Manual and embedded that into my own simulation. The type of phi2 (declared using transport equation in the Example) is changed to an algebraic variable, and phi2 is calculated using the same 'AdVarSource.F' code (offered in
examplesUserFortran).
phi2 can be calculated and no error occurs.
This puzzled me, so i checked my own code and deleted some unnecessary local variables. Finally and fortunately, the solver ran well and finished normally. Therefore, if the simulation is complex and large, trying to define variables in Fortran codes as little as possible.
PS: some spelling errors cannot be recognized when compile the code using cfx5mkext script in the command line, and the solver just stop without offering enough information. So, just be careful.
I spent two days to solve this problem and hope this information can be helpful for others.
-
November 24, 2017 at 12:39 am
Jimmyhan
SubscriberYour suggestion really helps. by the way, it is very important in my mass transfer simulation when I set source.
-
- The topic ‘A tip for CFX USER Fortran’ is closed to new replies.

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.
- legend min and max
- Ensight hot iron palette from an image
- Streamlines in EnSight using MRI data
- Import MRI data into Ensight
- FLUENT APPLICATIION ERROR
- Total Surface Heat Flux Calculation in Fluent
- Difference between “total pressure” and “absolute pressure”?
- Drop Test of a Water-Filled Tube
- Minimum Orthogonal Quality Less than 0.01 For Transonic Airfoil Flow Analysis
- obtaining pressure distribution by making points in ansys
-
8808
-
4658
-
3153
-
1680
-
1470
© 2023 Copyright ANSYS, Inc. All rights reserved.