CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   extract velocity gradient <user_getvar> error (https://www.cfd-online.com/Forums/cfx/181447-extract-velocity-gradient-user_getvar-error.html)

Ionut G December 14, 2016 11:04

extract velocity gradient <user_getvar> error
 
3 Attachment(s)
Hello all,

I need help regarding the command user_getvar.
I want to extract the velocity gradient using the command user_getvar.

I wrote a fortran code to compute the velocity in the boundary layer.
I compiled it using intel fortran compiler 14.0.3.202, it result 4 files including the .dll file which I need for ansys cfx but it gives me a warning, is it ok?
"ifort: command line warning #10161: unrecognized source type 'winnt-amd64\\stand
ard_wf.o'; object file assumed".

If I run the simulation with the files resulted by the compiler, the cfx solver stops returning with the following error:

Details of error:-
----------------
Error detected by routine MAKDIR
CDRNAM = VEL /GRADIENT
CRESLT = ILEG

Current Directory : /FLOW/ALGORITHM/ZN1/SYSTEM/VARIABLES

+--------------------------------------------------------------------+
| Writing crash recovery file |
+--------------------------------------------------------------------+

+--------------------------------------------------------------------+
| ERROR #001100279 has occurred in subroutine ErrAction. |
| Message: |
| Stopped in routine MEMERR |

In the fortran code, I want extract the velocity gradient like this:
"CALL USER_GETVAR('Velocity.Gradient', CRESLT, pGRAD_V, CZ,DZ,IZ,LZ,RZ)"

I attach the fortran code(standard_wf), the messages from compiler(compiler results), and the output file from solver(ansys error)

Thanks in advance for support.

cfdgremlin December 14, 2016 12:55

I think you need to specify a velocity component, e.g.

CALL USER_GETVAR('Velocity u.Gradient', ................

CG

Opaque December 14, 2016 15:50

I would try

'MyFluid.Velocity.Gradient'

as per the documentation

Quote:

You should always add the fluid name even though, in some cases such as for the variable Pressure, it is not strictly necessary. The fluid name is required when specifying a phase-specific variable (in a multiphase case) and when specifying an algebraic Additional Variable (even for a single-phase case).
Keep us posted..

Ionut G December 15, 2016 09:02

Hello cfdgremlin, thanks for the quick reply.

I have tried your suggestion, but it didn't work I have the same error.

Ionut G December 15, 2016 09:10

1 Attachment(s)
Hello Opaque, thank you for the quick reply.

I called the user_getvar command like you recommended and the error it is gone.

Now I have another error (I did the simulation in both single precision and double precision):
+--------------------------------------------------------------------+
| ERROR #001100279 has occurred in subroutine ErrAction.
| Message: |
| Floating point exception: Invalid number |


+--------------------------------------------------------------------+
| ERROR #001100279 has occurred in subroutine ErrAction.
| Message: |
| Stopped in routine FPX: C_FPX_HANDLER
| |

Can you help me?

ghorrocks December 15, 2016 17:20

This is a FAQ: https://www.cfd-online.com/Wiki/Ansy...do_about_it.3F

I would check that your simulation runs OK without the custom wall function.

Ionut G December 20, 2016 04:01

Hello Glenn,

Thank you for reply, I followed the instructions from FAQ section and it seems that the errors is from the fortran code.
I will post here when I will have a working code.

Thank you all for the support.

Ionut G January 16, 2017 10:15

Hi,

After I searched a little more and after some conversations with Ansys Support, it seems that I can not replace the scalable wall function with a custom wall function.

I will move to Fluent, there I can implement a custom wall function.

Thank you all for the support.


All times are GMT -4. The time now is 10:20.