CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   code in f90 (

dav April 6, 2002 11:01

code in f90
Dear All

I need to code the following equation

U_{t} + F(U)_{x} = S(U)

i've read lots of books and ref. etc. but I couldn't code the methods in f90. i was able only to code the case when S(U) = 0 using upwind methods etc. so can somebody help me by giveing me a 90 code to solve any linear or nonlinear case.

many thanks

versi April 6, 2002 22:28

Re: code in f90
Use Strang Splitting when S(U) really is a physcial source term. In each time step you first solve

U_t + F_x=0(PDE), then solve U_t=S (ODE). Check some text books on CFD.

Johnix April 8, 2002 14:24

Re: code in f90
I'm not sure whether I have understood your question. But I have an idea... Maybe u can try it.

since F=F(U)_{x}, you can also regard S(U) as S(U,x) i.e. S(U)_{x}

then you can get:

U_{t} + F(U)_{x} - S(U)_{x} = 0 =>

U_{t} + G(U)_{x} = 0 where G = F - S

dav April 10, 2002 07:34

Re: code in f90
S(U) is physical sourc term. so say we solve

U_t + F_x=0(PDE) using upwind methods, what shall i use to solve U_t=S (ODE)!!!

Upwind April 10, 2002 08:12

Re: code in f90
If you are using an upwind scheme for the flux the it is necessary to incoporate source terms in the upwind formulation otherwise the results could be inaccurate depending upon the strength of the source terms. You may want to consult the following paper for the upwind procedure to incorporate source terms:

Construction of Second-Order TVD Schemes for Non- homogeneous Hyperbolic Conservation Laws, L. Gascon and J.M. Corberan, J. of Computational Physics, Vol. 172, pp. 261-297(2001).

versi April 10, 2002 21:20

Re: code in f90
Generally, U_t=S(U) is very stiff, so you must use a stiff ODE solver.

dav April 11, 2002 09:48

Re: code in f90
what do you mean by:

U_t=S(U) is very stiff


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