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

Add Work due to body force in the energy equation for a lagrangian solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2015, 05:09
Default Add Work due to body force in the energy equation for a lagrangian solver
  #1
New Member
 
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15
mneben is on a distinguished road
Dear Foamers,

for multiphase flows with disperse particles the literature recommends the usage of a source term in the energy equation (Multiphase flows with droplets and particles, Crowe et.al., p. 445). This term shall mention the work due to body forces acting on the particle, mainly the work due to the drag force.
To get this I have to multiply the momentum source term with each cell’s number averaged particle velocity.
Now there is the problem:
How do I get an appropriate inner product of the momentum equation source term with a volVectorField?

An Example:
The momentum equation of the reactingParcelFoam-solver has on the left side a momentum source called parcels.SU(U).
Additionally one needs a volVectorField Up which corresponds to a averaged particle velocity in each cell.
Now I thought lets do something like Up&parcels.SU(U) and add this to the right side of the energy equation, but this fails because parcels.SU(U)is a Foam::tmp<Foam::fvVectorMatrix>.


Greetings

Matthias

Last edited by mneben; April 16, 2015 at 04:36.
mneben is offline   Reply With Quote

Old   April 15, 2015, 12:34
Default
  #2
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19
dkxls will become famous soon enough
Quote:
Originally Posted by mneben View Post
Now I thought lets do something like Up&parcels.SU(U) and add this to the left side of the energy equation, but this fails because because parcels.SU(U)is a Foam::tmp<Foam::fvVectorMatrix>.
Jep you cannot take the inner product of a volVectorField and fvVectorMatrix.

But you can get UTrans, which is a DimensionedField, and use that one to compute what you want since you are not interested in the boundary field anyways.
Have a look at:
Code:
src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H
-Armin
dkxls is offline   Reply With Quote

Old   April 27, 2015, 10:04
Default
  #3
New Member
 
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15
mneben is on a distinguished road
Hello Armin,

thanks for your quick response. According to your recommendation I checked
UTrans, especially the function calcVelocity written in KinematicParcel.C:

dUTrans += dt*(Feff.Sp()*(Ures.average() - Uc_) - Fcp.Su());

whereas Utrans will be calculated by
td.cloud().UTrans()[cellI] += np0*dUTrans

When there is no lift force Fcp.SU() should be zero and UTrans should be the drag force times the timestep.

To check this I created a test case with only one particle that is accelerated by the drag force. I added in uncoupledKinematicParcelFoam some lines


Info<<min(kinematicCloud.UTrans())<<endl;
Info<<min(kinematicCloud.UCoeff())<<endl;

Info<<max(kinematicCloud.UTrans())<<endl;
Info<<max(kinematicCloud.UCoeff())<<endl;

and switched coupled in thermoCloudProperties to true.
But I only got the following lines:


min(kinematicCloud:UTrans) [1 1 -1 0 0 0 0] (0 0 0)
min(kinematicCloud:UCoeff) [1 0 0 0 0 0 0] 0

max(kinematicCloud:UTrans) [1 1 -1 0 0 0 0] (0 0 0)
max(kinematicCloud:UCoeff) [1 0 0 0 0 0 0] 1.37330258e-09

UTrans is zero and has not the expected value, whereas UCoeff is correct (compared with the analytic solution of the drag force).

Why is Utrans zero? Where is my mistake?

Greetings
Matthias
mneben is offline   Reply With Quote

Old   April 28, 2015, 06:10
Default
  #4
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19
dkxls will become famous soon enough
Quote:
Originally Posted by mneben View Post
Why is Utrans zero? Where is my mistake?
Sorry, I cannot help you right much further since I would have to dig through the code and see what is really done there and I don't have time for that.

A couple of hints though:
  • Are you running time-accurate or steady state?
  • If you use a fully explicit coupling between Lagrangian and continuous phase, the source term in the momentum equation is (see KinematicCloudI.H):
    Code:
    fvm.source() = -UTrans()/(this->db().time().deltaT());
dkxls is offline   Reply With Quote

Old   November 30, 2015, 12:15
Default
  #5
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
Hi Matthias,

could you get new insights? I try to introduce the drag of all parcels in a cell as a bodyforce (like gravity) into interFoam, based on UncoupledKinematicParcelFoam. The one-way coupling works fine, but getting the momentum sources into the UEqn is hard.
vonboett is offline   Reply With Quote

Old   December 1, 2015, 09:02
Default
  #6
New Member
 
Matthias Neben
Join Date: Oct 2011
Location: Cottbus (Germany)
Posts: 28
Rep Power: 15
mneben is on a distinguished road
Hello vonboett,

a good reference for your question is the source code of the DPMFoam solver.

Here we can find the following lines:

fvVectorMatrix cloudSU(kinematicCloud.SU(Uc));

fvVectorMatrix UcEqn
(
fvm::ddt(alphac, Uc) + fvm::div(alphaPhic, Uc)
- fvm::Sp(fvc::ddt(alphac) + fvc::div(alphaPhic), Uc)
+ continuousPhaseTurbulence->divDevRhoReff(Uc)
==
(1.0/rhoc)*cloudSU
);


Greetings
Matthias
mneben is offline   Reply With Quote

Old   January 19, 2016, 06:30
Default
  #7
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
Hi Matthias,
I can really recommend
http://www.cfd-online.com/Forums/ope...tml#post547057
I managed to get the UEqn working but as soon as I add the explicit source of drag & buoyancy I'm getting unstable. Anyway, at least I can model one-way coupling including collisions
vonboett 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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
add source term in energy equation chaolian OpenFOAM Programming & Development 4 November 8, 2012 23:22
How to add time varying body force hsieh OpenFOAM Running, Solving & CFD 2 July 26, 2010 12:43
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
how to add body force in a duct jane FLUENT 0 March 28, 2004 00:13


All times are GMT -4. The time now is 17:10.