|
[Sponsors] |
ODE solver extension to RKtime integration for CFD |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 26, 2007, 06:18 |
I'm working on RK time integra
|
#1 |
Member
Luca Gasparini
Join Date: Mar 2009
Location: Italy
Posts: 37
Rep Power: 17 |
I'm working on RK time integration for a compressible flow solver.
I now would like to implement the RK-solver as an extension of the ODE/ODEsolver class. I understand that current ODE class only solves a system of scalar equations, while I obviously need to solve a mix of scalar/vector equations. I was thinking of doing something like: - specify n_scalars and n_vectors - specify y_scalars and y_vectors as well as dydx_scalars and dydx_vectors Could anybody suggest a better way ? Regards, Luca G. |
|
September 26, 2007, 06:28 |
Yes: the ODE solver works with
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Yes: the ODE solver works with the coeffs array and does not care much what's in it. Therefore, make an array of the size of number of scalars + 3*number of vectors, load up all the scalars and individual components into the coeffs and after the solution fill them back into your vectors. That way no intervention is required in the ODE base class or the solver and you will have a natural interface for scalars and vectors in your ODE.
Enjoy, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
September 26, 2007, 06:50 |
Thanks Hrvoje,
I was also t
|
#3 |
Member
Luca Gasparini
Join Date: Mar 2009
Location: Italy
Posts: 37
Rep Power: 17 |
Thanks Hrvoje,
I was also thinking of copying the components of the vector field into scalar fields and then back to the vector field, but wouldn't this cost the extra time to copy the fields back and forth ? Is there any way to avoid the copy ? Regards, Luca |
|
September 26, 2007, 07:11 |
There are ways, but it hurts.
|
#4 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
There are ways, but it hurts. In any case, the cost of copy is probably negligible. All field etc copies in OpenFOAM will cost you around 4% CPU time in total and there are some massive things being copied like for example matrices.
Unless you are solving hundreds of thousands of ODEs per time-step, I wouldn't sweat it. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
September 26, 2007, 07:44 |
Well, actually I will be solvi
|
#5 |
Member
Luca Gasparini
Join Date: Mar 2009
Location: Italy
Posts: 37
Rep Power: 17 |
Well, actually I will be solving for each cell in the grid which means millions of ODEs per time-step, plus there will be the extra memory usage of a copy of the fields.
It doesn't look optimal, although I agree it will probably increase only a few percent CPU time. Luca |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CAPTCHA extension activated | Jonas Larsson | CFD-Wiki | 0 | June 15, 2007 19:20 |
Extension for Interpolation files | Michael Bo Hansen | FLUENT | 1 | June 27, 2006 08:46 |
GLX extension Error | Andrew Garrard | FLUENT | 1 | October 27, 2004 07:27 |
Extension into z-axis | Farooq | FLUENT | 0 | November 26, 2003 08:09 |
FEMAP AND STP EXTENSION | Brenda E. Hall | Main CFD Forum | 0 | September 20, 1999 16:53 |