CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

ODE solver extension to RKtime integration for CFD

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 26, 2007, 05:18
Default I'm working on RK time integra
  #1
Member
 
Luca Gasparini
Join Date: Mar 2009
Location: Italy
Posts: 37
Rep Power: 8
luca_g is on a distinguished road
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.
luca_g is offline   Reply With Quote

Old   September 26, 2007, 05:28
Default Yes: the ODE solver works with
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   September 26, 2007, 05:50
Default Thanks Hrvoje, I was also t
  #3
Member
 
Luca Gasparini
Join Date: Mar 2009
Location: Italy
Posts: 37
Rep Power: 8
luca_g is on a distinguished road
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
luca_g is offline   Reply With Quote

Old   September 26, 2007, 06:11
Default There are ways, but it hurts.
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   September 26, 2007, 06:44
Default Well, actually I will be solvi
  #5
Member
 
Luca Gasparini
Join Date: Mar 2009
Location: Italy
Posts: 37
Rep Power: 8
luca_g is on a distinguished road
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
luca_g is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CAPTCHA extension activated Jonas Larsson CFD-Wiki 0 June 15, 2007 18:20
Extension for Interpolation files Michael Bo Hansen FLUENT 1 June 27, 2006 07:46
GLX extension Error Andrew Garrard FLUENT 1 October 27, 2004 06: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 15:53


All times are GMT -4. The time now is 01:59.