|
[Sponsors] |
Add extra body force (e.g. gravity) in simpleFoam: cavity example |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 2, 2014, 09:49 |
Add extra body force (e.g. gravity) in simpleFoam: cavity example
|
#1 |
New Member
Julien
Join Date: Dec 2014
Location: Switzerland
Posts: 1
Rep Power: 0 |
Hi everyone,
I heard lots of praises about OpenFOAM so I'm trying to get into it, but I have to admit it isn't as straightforward as I thought to set up a new model I need a steady-state solver for incompressible turbulent flows that are subject to an additional non-uniform body force. As a first step, I just want to use the cavity example (from icoFoam) with laminar flow, no initial pressure gradient, no initial velocity field and no lid movement, but taking the constant uniform field of gravity (0, -9.81, 0) into account. With this very simple example I expect to observe a nice pressure gradient from top to bottom of the cavity (constant in the x-direction). Here is what I did so far. Following this thread, I created a new solver "myFoam" based on simpleFoam. In order to read a constant force field I added this code Code:
Info<< "Reading field F\n" << endl; volVectorField F ( IOobject ( "F", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); Code:
solve(UEqn() == -fvc::grad(p) + F ); Code:
U -= rAU*(fvc::grad(p) - F ); Next, I took the cavity example and added the file "F" describing the gravity (internalField uniform (0 -9.81 0) in the constant directory. In the file 0/U I also set the initial velocity of the lid to zero. Since the parameters of the cavity example are intended for icoFoam and not simpleFoam, I then moved the files - constant/RASProperties - constant/transportProperties - system/controlDict - system/fvSchemes - system/fvSolution from the simpleFoam/pitzDaily example to my new cavity example. I set the RASmodel to laminar and call myFoam instead of simpleFoam in the controlDict file. Now when I run myFoam I get a "Floating point exception (core dumped)" after 50 steps, which isn't very nice... but what bothers me even more is the pressure field I obtain after 10 steps (see attached figure), which is far from resembling the one I was expecting Am I using the wrong approach or doing something wrong? Or has anyone another idea as to how I could achieve my objective? Thanks a lot in advance for your help! Best regards, Julien |
|
December 3, 2014, 09:47 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Have a look at the buoyantBoussinesqSimpleFoam and buoyantSimpleFoam solvers.
They include buoyancy forces. If you just want to see the effect of gravity on the pressure field (set the thermal expansion coefficient to 0 in the transportProperties file of the buoyantBoussinesqSimpleFoam solver). Tutorials are in $FOAM_TUTORIALS/heatTransfer/ directory |
|
December 7, 2016, 05:50 |
|
#3 |
New Member
rakesh
Join Date: Jul 2015
Location: Nagpur, India
Posts: 16
Rep Power: 11 |
Hi J Herb,
I have ran two similar cases of buoyantBoussinesqSimpleFoam solver, the only difference is that in one case gravity is enabled and in another without gravity. In both the cases I found the velocity profiles to be same. By the way as you suggested, I have set beta to be zero and there are no temperature gradients in the cases [to simulate simpleFoam kind of case with gravity included]. I am wondering that, the effect of gravity works in buoyantBoussinesqSimpleFoam when there is a difference in density of the fluid due to temperature? Kindly clarify my doubt. thanks |
|
December 13, 2016, 05:46 |
|
#4 | |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Quote:
https://github.com/OpenFOAM/OpenFOAM...oam/UEqn.H#L28 https://github.com/OpenFOAM/OpenFOAM...Foam/pEqn.H#L8 The density is calculated from the the temperature field: https://github.com/OpenFOAM/OpenFOAM...oam/TEqn.H#L26 So if you set beta to zero, there is no density gradient and therefore no difference between simpleFoam and buoyantBoussinesqSimpleFoam. Does this answer your question? |
||
December 14, 2016, 05:07 |
|
#5 |
New Member
rakesh
Join Date: Jul 2015
Location: Nagpur, India
Posts: 16
Rep Power: 11 |
||
December 15, 2016, 03:18 |
|
#6 |
Senior Member
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16 |
Why you add the force in the momentum corrector?
Sent from my GT-I8190L using CFD Online Forum mobile app |
|
December 17, 2016, 08:19 |
|
#7 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Do you know this: https://openfoamwiki.net/index.php/B...sinesqPisoFoam
Of course it's the PISO and not the SIMPLE algorithm but it might be a start: Check for the differences due to the gravitational force with the normal algorithm and then apply similar changes to the SIMPLE algorithm. |
|
Tags |
cavity, force, gravity, simplefoam, source |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SimpleFoam For cavity Problem | himanshu28 | OpenFOAM | 1 | January 16, 2013 02:49 |
Problems with SUPG body force term | FEM question | Main CFD Forum | 0 | January 21, 2006 18:51 |
how to include body force in cfx | selvam R.P | CFX | 4 | November 25, 2005 05:01 |
Body force | Jacob | FLUENT | 0 | August 4, 2003 17:38 |
How to add body force in CFX5.5 | Miko | CFX | 3 | June 17, 2003 23:11 |