
[Sponsors] 
November 22, 2006, 06:24 
Hello.
I am currently a MSc

#1 
New Member
Knut Erik Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 9
Rep Power: 9 
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 twophase EulerEuler 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! 

November 24, 2006, 21:11 
To have useful answers, maybe

#2 
Member
Ola Widlund
Join Date: Mar 2009
Location: Sweden
Posts: 87
Rep Power: 9 
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 proofofconcept, and something worthwhile for others to pick up and continue with. /Ola 

November 27, 2006, 07:24 
Hej,
I have problems with a

#3 
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 

November 27, 2006, 11:02 
Ola: Thank you for the respons

#4 
New Member
Knut Erik Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 9
Rep Power: 9 
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 navierstokes 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. 

November 27, 2006, 11:04 
Ola: Thank you for the respons

#5 
New Member
Knut Erik Giljarhus
Join Date: Mar 2009
Location: Norway
Posts: 9
Rep Power: 9 
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 navierstokes 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. 

Thread Tools  
Display Modes  


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 22: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 11:16 