CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Solver for system of hyperbolic equations (https://www.cfd-online.com/Forums/openfoam-programming-development/108202-solver-system-hyperbolic-equations.html)

treima October 17, 2012 05:29

Solver for system of hyperbolic equations
 
1 Attachment(s)
Hi,

I derived the adjoint equations from the twodimensional Eulerequation (with boundary conditions) in theory. Now I would like to solve these with OpenFOAM. Itīs a system of hyperbolic equations, so the normal discretisation of OF doesnīt work (Iīve tried ;) ).

The system is given by

a_{21} \Lambda_{2,x} + a_{31} \Lambda_{3,x} + a_{41} \Lambda_{4,x} + b_{21} \Lambda_{2,y} + b_{31} \Lambda_{3,y} + b_{41} \Lambda_{4,y} = 0,
\Lambda_{1,x} + a_{22} \Lambda_{2,x} + a_{32} \Lambda_{3,x} + a_{42} \Lambda_{4,x} + b_{22} \Lambda_{2,y} + b_{32} \Lambda_{3,y} + b_{42} \Lambda_{4,y} = 0,
a_{23} \Lambda_{2,x} + a_{33} \Lambda_{3,x} + a_{43} \Lambda_{4,x} + \Lambda_{1,y} + b_{23} \Lambda_{2,y} +  b_{33} \Lambda_{3,y} + b_{43} \Lambda_{4,y} = 0,
a_{24} \Lambda_{2,x} + a_{44} \Lambda_{4,x} + b_{34} \Lambda_{3,y} + b_{44} \Lambda_{4,y} = 0.

where the indices x and y mean the x and y derivation and the aīs and bīs are factors, dependent from the solution of the Eulerequation.

According to the solution of the onedimensional advection equation (you can have a look at this thread: http://www.cfd-online.com/Forums/ope...-equation.html) I tried to use a special discretisation with interpolation to the cell faces. You can find the code at the bottom.

For the solution I use the same timesteps like for the solution of the Eulerequation, but the adjoint solver is unstable and shows oscillations. My problem is, that I canīt explane me why ;).

Do you have any suggestions for a correct implementation for this system of hyperbolic equations or some hints, why my solver doesnīt work?

Thank you!


regards

treima

praveen October 21, 2012 10:34

You need to use an upwind scheme or add some dissipation.

In the scalar case, you are using a central scheme with implicit time scheme. This is L2 stable so the computations do not blow up. But you do not get monotone solution, your solution is not between [0,1] but is going out of this interval.


All times are GMT -4. The time now is 18:54.