Modeling the Earth's Mantle: is OpenFOAM a good candidate?
Hello all.
I'd like to figure out if OpenFOAM is a suitable candidate for a project I have in mind to model the Earth's upper mantle. I've read through the OpenFOAM documentation and tried a few of the tutorials after installing OpenFOAM in Ubuntu. Before I dive too far into the development of my project I thought it would be a good idea to ask the openfoam community about the feasibility of my project using openfoam and pitfalls that I may encounter or tips for packages to use. First a little background to let you know where I'm coming from. I just finished my master's studying flow in the Earth's upper mantle using this software package: http://geodynamics.org/cig/software/citcomcu CitcomCU is tailored to modeling the Earth's mantle, so in that sense it's a good product for the task. However, there are several key limitations: 1. Cartesian coordinates only for the mesh 2. No adaptive grid refinement 3. No native "open" boundary conditions (stress free in all 3 directions), and when I modified the boundary conditions in the source code I got somewhat "iffy" results. I already took a job in an unrelated field after graduation, but for my own edification and professional development I'd like to try to use another fluid dynamics model and set up the same types of systems to compare and benchmark the results. Enter OpenFOAM. Let me briefly lay out the system that I would like to model so that people can comment on how it might best be modeled in OpenFOAM: Model Domain: 3D cartesian coordinate space, ~ 800x400x12,800km. Boundary conditions: Temperature: constant top and bottom temperatures, temperature flux out the side boundaries Velocity: noslip on the top, free slip on 3 sides, stressfree open on bottom and one of the sides Equations to be solved: conservation of mass momentum and energy Flow type: Laminar boussinesq approximation timedependent, solution is expected to develop random droplets that fall from the top boundary, so no steady state solution is expected. There may be a statistical steady state reached after I run the model long enough. Viscosity: Arrhenius equation that includes the effects of temperature and pressure among other things. This equation will produce viscosities near the top of my model that go to infinity, but can be capped at ~1e30Pa*s . The viscosity will drop down to ~1e17Pa*s in the middle of the domain before returning to ~1e22Pa*s at the bottom of the domain. Solving for such a large viscosity contrast may be difficult? Particle tracking: Need to track certain characteristics via lagrangian particles that are advected passively within the domain. I know this can be tricky when you have open boundaries since some particles can leave the domain. I have a couple of ideas about how to handle this and don't mind digging into some source code to make my own solutions for this part. Meshing: Would really like to use a dynamic mesh that adds resolution to areas that have high viscosity contrast. Parallel: I definitely need this code to be parallelized, and would be interested in adding GPGPU capability (I've read about some linear solvers being developed for OpenFOAM+CUDA). So, I probably left out some relevant details, but does anyone have any thoughts on this project? 
OpenFOAM is very powerful. Most of what you talk about exists in OpenFOAM in some form, but you will have to write a custom solver. In terms of learning curves, you're looking at a few.
1. You could get a transient, laminar, boussinesq solver in one shot  finiteVolume and core library only (temperature being a scalar transport only). 2. I think the viscosity models are in the thermophysical library, which in my opinion is overly complicated. It uses five levels of embedded templating... but if you want energy, you'll need it, so that's your second learning curve. 3. Particle tracking is another one, but I believe it is much easier to understand than thermophysical. 4. Finally, dynamic meshing. If you want good dynamic meshing, go with OpenFOAMextend... I know they've put a lot of effort into it. But I don't know much about that. So there's your final learning curve. Once you learn OpenFOAM top to bottom, though, the world is your oyster. 
Quote:

Adaptive mesh refinement
A while back I tried adaptive mesh refinement on some problem involving shocks. It worked well, but I never found out how to apply it when running parallel. I couldn't make it to do redistribution of the cells, making it in principle useless on parallel calculations.
This could well be due to incompetence on my part, and I would appreciate if someone could give some hints about how parallel efficency can be achieved with AMR. OpenFOAMextend maybe? 
Actually, half a year ago, I am also interested in modeling this. However, something came up... :) But I'd like to hear your good news.

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