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

subroutine FORTRAN // CFX in Spain

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 23, 2006, 06:12
Default subroutine FORTRAN // CFX in Spain
  #1
spain
Guest
 
Posts: n/a
Hi! I've modified the subroutine used in the tutorial 17 (air conditioning) for my own sensor. If there is: H2 Ideal Gas.Mass Fraction > CLIM1 = 0.003 then I want my input of H2 to be closed.

The velocity Y of the input will be: H2_ON*10 [m s^-1]

CSENSOR = probe(Mixture.H2 Ideal Gas.Mass Fraction)@Detector,

where Detector is a Monitor Point.

Could somebody check if my routine is right?

#include "cfx5ext.h" dllexport(h2_on)

SUBROUTINE H2_ON (

& NLOC, NRET, NARG, RET, ARGS, CRESLT, CZ,DZ,IZ,LZ,RZ )

CD Control an input H2 by a sensor

#include "parallel_partitioning.h"

INTEGER NLOC,NARG,NRET

CHARACTER CRESLT*(*)

REAL ARGS(NLOC,NARG), RET(NLOC,NRET)

INTEGER IZ(*)

CHARACTER CZ(*)*(1)

DOUBLE PRECISION DZ(*)

LOGICAL LZ(*)

REAL RZ(*)

CHARACTER*20 ROUTIN

PARAMETER(ROUTIN='HEAT_SOURCE')

INTEGER ILOC, NCLOOP

REAL CSENSOR, CLIM1, VALUE

C initialize H2 input to be on

DATA VALUE/1.0/

C initialize the variable that keeps track of the last time step

DATA NCLOOPLAST/-1/

SAVE VALUE

C Initialise RET() to zero.

CALL SET_A_0( RET, NLOC*NRET )

CSENSOR = ARGS(1,1)

CLIM1 = ARGS(1,2)

NCLOOP = INT(ARGS(1,3)+0.1)

IF (NCLOOP .EQ. 1) THEN

C At the start of a new timestep. It is time to re-assess whether to turn on or off the H2 input.

IF (CSENSOR .GT. CLIM1) THEN

C Turn off H2 input

VALUE = 0.0

ELSE

VALUE = 1.0

ENDIF

ENDIF

DO ILOC = 1, NLOC

RET(ILOC,1) = VALUE

ENDDO

C Set success flag.

CRESLT = 'GOOD'

END

Does anybody know where I can find someone who knows how to use Ansys-CFX in Spain?? Thank you very much!!!
  Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 00:52
fortran subroutine to read mesh HaKu Main CFD Forum 0 May 23, 2011 12:36
error on CFX compile fortran subroutine billpeace CFX 0 May 18, 2006 04:44
how to use USER FORTRAN with CFX cfd_99 Main CFD Forum 1 June 4, 1999 05:42
CFX User Subroutine Archive David Creech Main CFD Forum 0 March 17, 1999 13:41


All times are GMT -4. The time now is 08:37.