CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CD-adapco (http://www.cfd-online.com/Forums/cd-adapco/)
-   -   passive scalars (http://www.cfd-online.com/Forums/cd-adapco/53650-passive-scalars.html)

CMB February 15, 2004 15:34

passive scalars
 
Hi, I defined some passive scalars in my model because these donot influence dependant variables and are not part of the solving equations. So I have been assigning them values with: t(is,1+nsc)=value(ip) An error appears while running, it says error#076, negative densities found at more than 100 cells! When I take away this command line of the program, it runs well. These scalars have no direct or indirect influence on the density calculation. I appreciate any help or suggestions Regards, c

Richard February 16, 2004 04:01

Re: passive scalars
 
If you want to write to the T() array directly like that, you have to make sure that you have allocated the memory correctly, otherwise you will be over-writing memory which STAR is using for something else. Perhaps this memory corruption is the cause of the negative densities. To define the values of a scalar explicitly, it is much better to use the built-in capabilities of STAR: define a passive scalar with "Solution Method"="User". This will activate the SCALFN user subroutine, in which you can specify PHI (the scalar value) for scalar IS in cell IP, as a function of the usual local field values.

CMB February 16, 2004 10:46

Re: passive scalars
 
hi richard, you are right,the memory was overwriting itself, I tried to define my passive scalars using SCALFN but did'nt work. This is very strange, I defined that in the solution method and specified them to be solved by this subroutine, but it did'nt work. Instead I define the calculation to be done only once per time step, with the following: if(intflg(1).eq.0)then / intflg(2)=-1 / intflg(1)=1 / endif / if(intflg(2).ne.iter) then / coding / intflg(2)=iter / endif. And it worked!! Many thanks C.


All times are GMT -4. The time now is 10:43.