|
[Sponsors] |
November 18, 2010, 04:49 |
'USER_GET_GVAR' usage
|
#1 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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 |
|
November 18, 2010, 09:01 |
|
#2 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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 |
|
November 18, 2010, 11:10 |
|
#3 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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. |
|
November 18, 2010, 18:21 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,729
Rep Power: 143 |
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. |
|
November 19, 2010, 02:28 |
|
#5 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
thank you Glenn Horrocks
we discuss about it in 'pressure calculation-junction box' Thread. and i have to use it. |
|
November 19, 2010, 03:40 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,729
Rep Power: 143 |
I can't find the thread you refer to.
Can you explain why you have to use it? |
|
November 19, 2010, 11:18 |
|
#7 | |
New Member
ousegui
Join Date: Oct 2010
Posts: 19
Rep Power: 15 |
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:
|
||
November 20, 2010, 03:33 |
|
#8 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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 12:27. |
|
November 20, 2010, 07:28 |
|
#9 |
Member
Join Date: Dec 2009
Posts: 44
Rep Power: 16 |
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. |
|
November 20, 2010, 12:29 |
|
#10 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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? |
|
November 21, 2010, 10:10 |
|
#11 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
with which routine can get the cell(node,element) data like cell pressure.
|
|
November 26, 2010, 03:27 |
|
#12 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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? |
|
November 26, 2010, 13:34 |
|
#13 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
Did you attend a user fortran training by ANSYS?
|
|
November 26, 2010, 13:55 |
|
#14 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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 |
|
November 28, 2010, 13:49 |
|
#15 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
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.
|
|
November 28, 2010, 17:09 |
|
#16 | ||
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,729
Rep Power: 143 |
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:
Quote:
|
|||
November 29, 2010, 03:35 |
|
#17 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
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. "You do not set pressure at a wall" --> yes,it is write.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. 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? |
|
November 29, 2010, 17:02 |
|
#18 | ||
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,729
Rep Power: 143 |
Fluent gives more access to this sort of stuff that CFX.
Quote:
Quote:
|
|||
December 1, 2010, 08:47 |
|
#19 |
Member
h-h
Join Date: Sep 2009
Posts: 38
Rep Power: 16 |
Tank you Glenn Horrocks.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FloWorks and CPU usage? | cvp_dk | FloEFD, FloWorks & FloTHERM | 6 | June 20, 2011 08:57 |
sormon.f usage for fixing a constant velocity for defined cellset | Tilak | Main CFD Forum | 0 | November 1, 2009 07:15 |
OpenFOAM Solver/BC usage description | murrayjc | OpenFOAM | 3 | August 25, 2009 04:48 |
Swap usage on parallel run | nikhilesh | OpenFOAM Running, Solving & CFD | 0 | April 30, 2009 09:50 |
Swap usage on parallel run | nikhilesh | OpenFOAM Bugs | 1 | April 30, 2009 04:42 |