CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   udf for chemical reduction scheme (https://www.cfd-online.com/Forums/fluent-udf/123771-udf-chemical-reduction-scheme.html)

yorelchr September 20, 2013 10:55

udf for chemical reduction scheme
 
Hi everyone,

I am trying to use a reduced scheme mechanism in Fluent. My problem for the moment is to understand if Fluent reads my UDF or not.
The udf is a DEFINE_NET_REACTION_RATE and it is calling a subroutine written in Fortran.

The UDF (rate_driver.c) :

DEFINE_NET_REACTION_RATE(boivin_4_steps, c, t, particle, p, temp, yi, rr, jac)
{
ckwyp_( n, p, temp, yi, rr );
}

The ckwyp subroutine (boivin_4_steps.f):

subroutine ckwyp(P, T, Y, WDOT)
IMPLICIT DOUBLE PRECISION (A-H, O-Z), INTEGER (I-N)
PARAMETER (IGLO=3,IREAC=12,KK=6)
DIMENSION Y(*), WDOT(*)
DIMENSION XM(IREAC), RF(IREAC), RB(IREAC), W(IREAC), WT(KK)
DIMENSION RKF(IGLO),XCON(KK)
DATA SMALL/1.D-50/
DATA RU/8.314510D3/
DATA WT/2.016, 1.008, 31.999, 18.015, 34.015, 28.013/

[.....]

RETURN
END

So my question is : are my variables correctly declared? I'm a bit confused with C/Fortran...Written like this, does the DEFINE_REACTION_NET_RATE really calls the ckwyp subroutine?
When compiling and loading the UDF, I have no problem (I've build the libudf directories (src, lnamd64, 2ddp ...), then put the correct makefile.udf and makefile.udf2 in the good directories....then compiled the fortran program with g77 ... then command make "FLUENT_ARCH"=lnamd64 ....no problem and no errors with that. But when my case runs in Fluent, I don't know if it really takes the UDF into account: my flame stops burning after 100 iterations...

Any advice would be really nice !!!
Thanks a lot

Christine


All times are GMT -4. The time now is 03:07.