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

Some questions about implementing a new solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2006, 05:24
Default Hello. I am currently a MSc
  #1
Member
 
Knut Erik T. Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 35
Rep Power: 22
eric will become famous soon enough
Hello.

I am currently a MSc student working with CFD. For my final project, I'm considering implementing a new solver in OpenFOAM.
The solver is an incompressible two-phase Euler-Euler method, based on the level set method. For about a year now, I've been using
a FORTRAN code for this model, but now we want to implement the energy equation, turbulence models and/or electromagnetic forces,
and I figured it might be easier to implement the level set method in OpenFOAM rather than to implement all the other stuff in the FORTRAN code.
The code is already getting quite messy, and I suspect that an object oriented approach would be much better for a code of this size.
The object oriented way of representing solvers and discretization schemes used in OpenFOAM seems very elegant and powerful.

So my question is how difficult would it be for me to do this? I probably would have to implement some new discretization schemes
and some new procedures related to the method. I'm somewhat familiar with object oriented programming, but only in Java and
Python, not in C++. I've gone through all the tutorials in the user's guide, and also modified some of the existing solvers without
too many difficulties. But I'm a bit worried that too much of my time will be spent scratching my head over compile errors and segmentation faults.
At the same time, it would probably be a great advantage for later research to get comfortable with running and developing OpenFOAM.
The time available for the project is one semester, i.e. from early January to late June.

I realize that this is not an easy question to answer, but any reassurances, dissuations or other comments are greatly appreciated!
eric is offline   Reply With Quote

Old   November 24, 2006, 20:11
Default To have useful answers, maybe
  #2
Member
 
Ola Widlund
Join Date: Mar 2009
Location: Sweden
Posts: 87
Rep Power: 17
olwi is on a distinguished road
To have useful answers, maybe you should make a list of the new things and complications you need to deal with: (i) what equations to solve? (ii) what is special about the discretisation? (iii) strange boundary conditions?

Putting the energy equation, turbulence models and electromagnetic forces into your Fortran code? Forget about it, not even for a full Ph D... Even if you did, it has no future, it's a dead end. I'd say OpenFOAM is your best shot to make at least a decent proof-of-concept, and something worthwhile for others to pick up and continue with.

/Ola
olwi is offline   Reply With Quote

Old   November 27, 2006, 06:24
Default Hej, I have problems with a
  #3
mss
Guest
 
Posts: n/a
Hej,

I have problems with adding a user application class.
When typing "echo $FOAM_USER_CONFIG" I just receive a empty line as
answer....?
Could anyone help me with this problem?

thank you,
Rita
  Reply With Quote

Old   November 27, 2006, 10:02
Default Ola: Thank you for the respons
  #4
Member
 
Knut Erik T. Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 35
Rep Power: 22
eric will become famous soon enough
Ola: Thank you for the response. There is only one extra equation to solve, the convection equation for the level set function:
ddt(phi)+u*grad(phi)=0
There is also an extra term to be added in the navier-stokes equations, due to surface tension.
In addition, the level set field has to be reinitialized, using a similar, but hyperbolic, equation.

For discretization, perhaps the already existing schemes in OpenFoam may be used, but on staggered, uniform grids a 5th order WENO method should be used for the convective terms to achieve good results.

The boundary condition used is usually just zeroGradient, so that shouldn't be a problem.

I agree that implementing all of it into the FORTRAN code is a dead end, but it would be a good academic exercise to do just one of them, I think.
eric is offline   Reply With Quote

Old   November 27, 2006, 10:04
Default Ola: Thank you for the respons
  #5
Member
 
Knut Erik T. Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 35
Rep Power: 22
eric will become famous soon enough
Ola: Thank you for the response. There is only one extra equation to solve, the convection equation for the level set function:
ddt(phi)+u*grad(phi)=0
There is also an extra term to be added in the navier-stokes equations, due to surface tension.
In addition, the level set field has to be reinitialized, using a similar, but hyperbolic, equation.

For discretization, perhaps the already existing schemes in OpenFoam may be used, but on staggered, uniform grids a 5th order WENO method should be used for the convective terms to achieve good results.

The boundary condition used is usually just zeroGradient, so that shouldn't be a problem.

I agree that implementing all of it into the FORTRAN code is a dead end, but it would be a good academic exercise to do just one of them, I think.
eric is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem implementing CVODE ODE solver markusrehm OpenFOAM 20 October 13, 2010 17:02
Implementing new bcbs srinath OpenFOAM 3 September 3, 2008 05:11
Questions to Dynamic Mesh solver and diffusivity florian_krause OpenFOAM Running, Solving & CFD 12 January 11, 2008 21:33
questions concerning solver and multigrid methodes youradvice Main CFD Forum 1 August 6, 2007 15:27
implementing the CFL criterion Ben Houston Main CFD Forum 1 December 4, 2002 10:16


All times are GMT -4. The time now is 07:47.