CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CD (https://www.cfd-online.com/Forums/star-cd/)
-   -   Look-up table for combustion problem (https://www.cfd-online.com/Forums/star-cd/108991-look-up-table-combustion-problem.html)

lost.identity November 6, 2012 12:06

Look-up table for combustion problem
 
Hi,

I'm trying to use a user-defined combustion model in Star-CD. I do this by including additional scalars where the source terms are included in sorsca.f.

However, the problem I'm facing is the model I'm using uses a look-up table. Ideally, I would like this look-up table to be called only once and have the data from the table saved in arrays which will be used later during the computations.

If I read this table in sorsca.f, does that mean it will be read at every cell and at every time step?

That will significantly slow down my code. Is it possible to read it at the start of the calculations?

Thanks!

Pauli November 6, 2012 13:12

You need to wrap the file read in a conditional which only allows the file read the first time through. INTFLG is an array you can use to store the conditional value.

C ... Set flag to only read files on first pass
if( INTFLG(14).ne.-999 )then
INTFLG(14) = -999
open(180,file='MyFile.txt',status='old')
i = 1
11 read(180,*,end=21) x,y,z
i = i+1
goto 11
21 continue
close(180)
ndata_1 = i-1
endif


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