|
[Sponsors] |
February 26, 2008, 05:47 |
Loading expressions into fortran routine
|
#1 |
Guest
Posts: n/a
|
Hi,
Is there a way for me to load expressions defined in CFX-Pre into my fortran routine for use in a transient run. eg. if I have an expression FX = force_x()@Structure - can this be accessed in my fotran routine? (I know there are other ways to achieve the resulting force on a boundary, but the question here is how to load an expression into my fortran routine). - ats |
|
February 26, 2008, 10:20 |
Re: Loading expressions into fortran routine
|
#2 |
Guest
Posts: n/a
|
Dear ats,
That cannot be done directly. There several alternatives Alternative 1: done by using USER_GET_GVAR. Please take a look at the documentation. For an example, CALL USER_GET_GVAR (' ','Structure','force_x', & CRESLT,REXPRESSION, & CZ,DZ,IZ,LZ,RZ) CALL USER_PRINT_REAL('area_x()@Inlet',REXPRESSION) Alternative 2: Create an Additional Variable, set it as an Algebraic Equation, and make it equal to force_x()@Structure. Then, pass it as argument list to your USER CEL function (fortran routine). Hope this helps, Opaque |
|
February 26, 2008, 10:29 |
Re: Loading expressions into fortran routine
|
#3 |
Guest
Posts: n/a
|
Thank you for the reply.
Alternative 1 is not a possibility, simply because in this case I need area integrated values that aren't integrated over the entire boundary. Alternative 2 could work I suppose, but will it not take an entire column in ARGS of size (NLOC,1) ? - ats |
|
February 26, 2008, 10:54 |
Re: Loading expressions into fortran routine
|
#4 |
Guest
Posts: n/a
|
I tried creating an additional variable:
FX: Variable type - Specific Units - [N] Tensor Type - Scalar and in Domain/Fluid Models I set it to "Algebraic Equation" with the expression "force_x()@Structure". When I use this as argument for my CEL function I get the following msg in the .out file: ERROR #001100279 has occurred in subroutine ErrAction. Message: The fluid/solid qualifier for the additional variable FX cannot be determined. Please ensure that the name is prefixed with the fluid or solid name. Any pointers? - ats |
|
February 26, 2008, 12:01 |
Re: Loading expressions into fortran routine
|
#5 |
Guest
Posts: n/a
|
Dear ats,
I think the message is very clear. The solver is expecting (not sure why) that you prefix the variable FX by the fluid/solid using it. Try doing so, as in MyFluid.force_x()@Structure, where MyFluid is the name of the fluid you are using. Also, the single value will use a full array (1:NLOC) since the mechanism to transfer data does not differentiate a single value from a multivalue arg list. It only knows is a variable. Opaque |
|
February 26, 2008, 20:08 |
Re: Loading expressions into fortran routine
|
#6 |
Guest
Posts: n/a
|
Ok thank you, I will try that
- ats |
|
February 27, 2008, 05:35 |
Re: Loading expressions into fortran routine
|
#7 |
Guest
Posts: n/a
|
I have tried changing my additional variable to 'Air at 25 C.force_x()@Structure', which does not cause for any warnings in PRE. However when I run the solver, I get the following two errors:
ERROR #001100279 has occurred in subroutine ErrAction Message: An error: Illegal Vector Component for callback function force_x()@Structure Details of error:- ---------------- Error detected by routine MAKDAT CDANAM = LVAR CDTYPE = INTR ISIZE = 90 CRESLT = OLD Current Directory : /FLOW/ALGORITHM/ZN1/SYSTEM/VARIABLES I really am desperate to figure this out, as it is halting all progress. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
user routine, user funcion, or fortran compile effect on the memroy? | princeps11 | CFX | 1 | May 13, 2009 19:37 |
user subroutine error | CFDUSER | CFX | 2 | December 9, 2006 07:31 |
user defined function | cfduser | CFX | 0 | April 29, 2006 11:58 |
FORTRAN Routine - variable passing | Malcolm | CFX | 1 | August 11, 2005 19:51 |