CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLOW-3D (
-   -   Modifying Source Files in Flow3D Directories (

Xizao Yang January 12, 2009 21:18

Modifying Source Files in Flow3D Directories
Dear all,

I was working on a concentration problem and wanted to add a decaying source to it. I looked through the Fortran files in the source folder and thought that some slight modification here may be needed to decrease the scalar (concentration in this case) as retention time increases. One of the files I located was


which contains scalar information and scalar sources. Has anyone done this kind of modification before? Can you please offer me some suggestions? I appreciate your time.


Stefano January 14, 2009 09:15

Re: Modifying Source Files in Flow3D Directories
that fortran file should be good. I did something like that once, but I'm not sure what you mean by "retention" time. I paste here my lines, keeping free the function to change your scalar so you can personalize that line with the funcion you want:

if (idum1>0) then

do k=kprb,kprt

do j=jprf,jprbk

do i=iprl,iprr

include '../comdeck/ijk.f'

if( cycle

if(vf(ijk).lt.em6) cycle

if(fn(ijk).lt.emf .and. nmat.eq.1) cycle

if ((sclr(ijk,idum2)<=0)) cycle

sclr(ijk,idum2)=sclr(ijk,idum2)/t !!!!!!!!!!

end do

end do

end do endif

idum1 is a my flag to activate or deactivate the customization. The first lines skip thru all the cells, skipping the ones that are empty or fully blocked, or that don't contain my scalar. So, finally, for each cell that contain my scalar, I decrease it's value as a function of time. (line !!!!!!!!!) You can change here this function.

Xizao Yang January 15, 2009 00:35

Re: Modifying Source Files in Flow3D Directories
Hello Stefano, thanks for the suggestion, hope it works.

Also, sorry about the confusion surrounding "retention" time, I actually meant software running time.

Stefano January 15, 2009 04:02

Re: Modifying Source Files in Flow3D Directories
probably it works only from version 9.2 on , because it use the unstructured memory allocation, but I'm not sure on this, we should ask to FlowScience staff. But if you use 9.2 or newer you'll not have any problem.

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