CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

'USER_GET_GVAR' usage

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2010, 05:49
Default 'USER_GET_GVAR' usage
  #1
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
hello
I want to use just 'USER_GET_GVAR'.
can somebody give me real and complete example of it uses.
for example i want to use this in my 'name.F' file:
CALL USER_GET_GVAR('pabs','Default Domain',' ', CRESLT,VAR, CZ,DZ,IZ,LZ,RZ)
IF (pabs.LE.0) THEN
pabs=0
ENDIF
what must be in the '.F' file?
thanks
hosseinhgf is offline   Reply With Quote

Old   November 18, 2010, 10:01
Default
  #2
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
what is wrong in this
#include "cfx5ext.h"
dllexport(stopinteg)
SUBROUTINE STOPINTEG (CZ,DZ,IZ,LZ,RZ)
#include "MMS.h"
#include "cfd_constants.h"
CHARACTER CZ(*)*(1)
DOUBLE PRECISION DZ(*)
INTEGER IZ(*)
LOGICAL LZ(*)
REAL RZ(*)
CHARACTER*(4) CRESLT
REAL VAR,newpressure
CALL USER_GET_GVAR ('pabs','JBEARING',
& CRESLT,newpressure,CZ,DZ,IZ,LZ,RZ)
IF (pabs.LE.0) THEN
pabs=0
ENDIF
END
hosseinhgf is offline   Reply With Quote

Old   November 18, 2010, 12:10
Default
  #3
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
when i use this, no error occur in solver:
#include "cfx5ext.h"
dllexport(stopinteg)
SUBROUTINE STOPINTEG (CZ,DZ,IZ,LZ,RZ)
#include "MMS.h"
#include "cfd_constants.h"
#include "stack_point.h"
CHARACTER CZ(*)*(1)
DOUBLE PRECISION DZ(*)
INTEGER IZ(*)
LOGICAL LZ(*)
REAL RZ(*)
CHARACTER*(4) CRESLT
CALL USER_GET_GVAR ('pabs','bearingu','ave',
& CRESLT,newpressure,CZ,DZ,IZ,LZ,RZ)
IF(pabs.LE.0) THEN
newpressure=0
ENDIF
END
and noting happend in results.
i want to set pressure of all cell with negative absolute pressure to zero and i don t want use 'ave' or any Operation.
for example when using if(pabs<0, ,) cel expression , cfx compare all cell pressure.
hosseinhgf is offline   Reply With Quote

Old   November 18, 2010, 19:21
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,665
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I am no expert in CFX fortran but crudely setting all negative absolute pressures to zero sounds like a bad idea to me.

Firstly because this will break mass conservation as it is not incorporated into the mass conservation equations.
Secondly because there is no way this will ever converge
Thirdly because negative absolute pressures are usually caused by some problem in your simulation setup. Fix the problem at the root cause.
ghorrocks is offline   Reply With Quote

Old   November 19, 2010, 03:28
Default
  #5
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
thank you Glenn Horrocks
we discuss about it in 'pressure calculation-junction box' Thread.
and i have to use it.
hosseinhgf is offline   Reply With Quote

Old   November 19, 2010, 04:40
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,665
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I can't find the thread you refer to.

Can you explain why you have to use it?
ghorrocks is offline   Reply With Quote

Old   November 19, 2010, 12:18
Default
  #7
New Member
 
ousegui
Join Date: Oct 2010
Posts: 19
Rep Power: 15
ousegui is on a distinguished road
Hi
I have not used fortran since long time Fortran in CFX, but if I remember try to add __stack_point__ newpressure before calling GetVar


Quote:
Originally Posted by hosseinhgf View Post
when i use this, no error occur in solver:
#include "cfx5ext.h"
dllexport(stopinteg)
SUBROUTINE STOPINTEG (CZ,DZ,IZ,LZ,RZ)
#include "MMS.h"
#include "cfd_constants.h"
#include "stack_point.h"
CHARACTER CZ(*)*(1)
DOUBLE PRECISION DZ(*)
INTEGER IZ(*)
LOGICAL LZ(*)
REAL RZ(*)
CHARACTER*(4) CRESLT
CALL USER_GET_GVAR ('pabs','bearingu','ave',
& CRESLT,newpressure,CZ,DZ,IZ,LZ,RZ)
IF(pabs.LE.0) THEN
newpressure=0
ENDIF
END
and noting happend in results.
i want to set pressure of all cell with negative absolute pressure to zero and i don t want use 'ave' or any Operation.
for example when using if(pabs<0, ,) cel expression , cfx compare all cell pressure.
ousegui is offline   Reply With Quote

Old   November 20, 2010, 04:33
Default
  #8
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
thank you
one of the B.C that use for 'journal bearing' is 'half sommerfeld' and i
must be use it in my thesis.
that thread now is in page 3.

________________________________________
I use '__stack_point__ newpressure' but nothing change.
why when i use 'CALL MESAGE ( 'WRITE','nv=',nv)' there is nothing in opposite of nv= at solver out file.

#include "cfx5ext.h"
dllexport(stopinteg)
SUBROUTINE STOPINTEG (CZ,DZ,IZ,LZ,RZ)
#include "MMS.h"
#include "cfd_constants.h"
#include "stack_point.h"
__stack_point__ newpressure
CHARACTER CZ(*)*(1)
DOUBLE PRECISION DZ(*)
INTEGER IZ(*)
LOGICAL LZ(*)
REAL RZ(*),nv
CHARACTER*(4) CRESLT
CALL USER_GET_GVAR ('pabs','JBEARING','ave',
& CRESLT,newpressure,CZ,DZ,IZ,LZ,RZ)
IF (CRESLT.NE.'GOOD') STOP
nv=1
CALL MESAGE ( 'WRITE','nv=',nv)
END

Last edited by hosseinhgf; November 20, 2010 at 13:27.
hosseinhgf is offline   Reply With Quote

Old   November 20, 2010, 08:28
Default
  #9
Member
 
Join Date: Dec 2009
Posts: 44
Rep Power: 16
cfdgremlin is on a distinguished road
If I understand your previous comments, you are going about this the wrong way.

You have created a Junction Box Routine within which you call USER_GET_GVAR to get the average pressure on your location. What you then do is try to set some real variable pabs to zero, but this variable is a local one to the routine - the solver knows nothing about it. What you would have to do as well is POKE the values into the correct MMS directories to replace the values the solver is using.

If you really do want to set the pressure on some location, based on the result of a call to USER_GET_GVAR, then you are better off using a User CEL Function. You can then loop through all the vertices/integration points/face centres to set the desired value.

There are several examples in the user documentation of how to set values on boundaries and other locations with User CEL Routines.
cfdgremlin is offline   Reply With Quote

Old   November 20, 2010, 13:29
Default
  #10
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
thanks for your information

you mean i use
SUBROUTINE POKER (CDANAM, JADRES, RVALUE, CERACT, CRESLT, RZ)

i want to set negative absolute pressure to zero in my domain not boundary but because of very thin fluid film thickness i can use it in boundary.

my boundary is wall and i dont know where use 'User CEL Routines' to set pressure.
for example in 'User CEL Example 1: User Defined Momentum Source'
user CEL function used to set the momentum source components within the subdomain.

"There are several examples in the user documentation of how to set values on boundaries and other locations with User CEL Routines."--> what are these values?
hosseinhgf is offline   Reply With Quote

Old   November 21, 2010, 11:10
Default
  #11
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
with which routine can get the cell(node,element) data like cell pressure.
hosseinhgf is offline   Reply With Quote

Old   November 26, 2010, 04:27
Default
  #12
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
in fluent there are macros that can

Loop over all cell threads in domain d:
"thread_loop_c(ct,d)"

and

Loop over all cells in a cell thread t:
"begin_c_loop(c, t)
end_c_loop (c,t)"

which subroutine or how can do this in cfx?
hosseinhgf is offline   Reply With Quote

Old   November 26, 2010, 14:34
Default
  #13
Senior Member
 
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17
joey2007 is on a distinguished road
Did you attend a user fortran training by ANSYS?
joey2007 is offline   Reply With Quote

Old   November 26, 2010, 14:55
Default
  #14
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
if you mean "training manual" for CFX 12 yes i use it but it has a Lectures about CEL and nothing about fortran.
thank you
hosseinhgf is offline   Reply With Quote

Old   November 28, 2010, 14:49
Default
  #15
Senior Member
 
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17
joey2007 is on a distinguished road
On request ANSYS may offer you a special training for user fortran. Guess it is really difficult to implement a such a complicated project like yours without the help opf ANSYS.
joey2007 is offline   Reply With Quote

Old   November 28, 2010, 18:09
Default
  #16
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,665
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I have said it before and I will say it again.

What are proposing to do will not work so I would not waste your time trying to do it. You will loose mass conservation and it will not converge.

You said:
Quote:
i want to set negative absolute pressure to zero in my domain not boundary but because of very thin fluid film thickness i can use it in boundary.
I do not understand what you are saying here. Can you explain that further?

Quote:
my boundary is wall and i dont know where use 'User CEL Routines' to set pressure.
You do not set pressure at a wall. The pressure is determined by conservation of mass, momentum and energy (ie the Navier Stokes equations). This is why I say if you arbitrarily set the pressure at a wall to a value you will break the solver.
ghorrocks is offline   Reply With Quote

Old   November 29, 2010, 04:35
Default
  #17
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
thank you
after one week that i switch to fluent finally i wrote a udf and it work very good look like this journal :
"CFD analysis of journal bearing hydrodynamic lubrication by bingham lubricant"
but the bad things is it can work with one processor.
I think CEL expression is the best things in cfx because in fluent i must write a new udf for dynamic mesh.i think JBR is not very good to compare of udf. fluent udf Manual is very complete to compare of user fortran.

"You do not set pressure at a wall" --> yes,it is write.
Cfdgremlin said "There are several examples in the user documentation of how to set values on boundaries and other locations with User CEL Routines." ---> yes it is.for example you can set your velocity data to inlet boundary whit user cel routines. but with user cel routines how we can set pressure.

in one journal(Application of CFD Analysis for Rotating Machinery—Part I Hydrodynamic_ Hydrostatic Bearings and Squeeze Film Damper) Authors use CFX-TASCflow to simulation and use "half sommerfeld" boundary condition.what is different between cfx and CFX-TASCflow?

can i use "FSI" to set my condition?
hosseinhgf is offline   Reply With Quote

Old   November 29, 2010, 18:02
Default
  #18
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,665
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Fluent gives more access to this sort of stuff that CFX.

Quote:
for example you can set your velocity data to inlet boundary whit user cel routines. but with user cel routines how we can set pressure.
You can set the velocity at an inlet boundary as that boundary uses velocity as an input. Unless you are using a pressure boundary you will not be able to set pressure - so you will not be able to set pressure at a wall.

Quote:
can i use "FSI" to set my condition?
No.
ghorrocks is offline   Reply With Quote

Old   December 1, 2010, 09:47
Default
  #19
Member
 
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16
hosseinhgf is on a distinguished road
Tank you Glenn Horrocks.
hosseinhgf is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FloWorks and CPU usage? cvp_dk FloEFD, FloWorks & FloTHERM 6 June 20, 2011 09:57
sormon.f usage for fixing a constant velocity for defined cellset Tilak Main CFD Forum 0 November 1, 2009 08:15
OpenFOAM Solver/BC usage description murrayjc OpenFOAM 3 August 25, 2009 05:48
Swap usage on parallel run nikhilesh OpenFOAM Running, Solving & CFD 0 April 30, 2009 10:50
Swap usage on parallel run nikhilesh OpenFOAM Bugs 1 April 30, 2009 05:42


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