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

source term units in icoFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By chemak
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 13, 2024, 11:45
Default source term units in icoFoam
  #1
Member
 
Divyaprakash
Join Date: Jun 2014
Posts: 71
Rep Power: 12
Divyaprakash is on a distinguished road
I have added a source term (body force), F, in openfoam icofoam solver.



Code:
  // Momentum predictor
        fvVectorMatrix UEqn
        (
            fvm::ddt(U)
          + fvm::div(phi, U)
          - fvm::laplacian(nu, U) + F 
        );
According to homegneity of the equation the F should have a unit of [m/s^2].

Does that mean that the force I need to add to the source should be divided by the volume and the density. However density isn't mentioned in the icoFoam solver.



I think I have stumbled upon something trivial which I am unable to understand. Please guide me.
Divyaprakash is offline   Reply With Quote

Old   March 14, 2024, 05:12
Default
  #2
New Member
 
Join Date: Nov 2017
Posts: 6
Rep Power: 9
chemak is on a distinguished road
That's an interesting question.


The body force in the momentum equation is an intensive quantity, so it is always devided by the volume. If your F is a gravity like force, then you just need to put the acceleration. If the force applied on your flow is expressed in Newton, then you need to divide by the total volume of your domain (which is closed volume I suppose), and divide by the density which you fix according to your physical problem. Of course density is constant in all your domain.



It's true that icoFoam doesn't mention the density as it solves the incompressible form of the mementum equation, but you should be aware of it if you try to simulate a dimentioned physical problem. Keep in mind that the p in icoFoam a specific pressure (pressure/density) and you always need to know the density if you want to get dimentioned quantities during post-processing.
Divyaprakash likes this.
chemak is offline   Reply With Quote

Old   March 14, 2024, 05:46
Default
  #3
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 735
Rep Power: 14
Tobermory will become famous soon enough
In the incompressible solvers, like icoFoam, the momentum equation is divided through by (the constant) density ... and so pressure is kinematic and has units of (Pa)/(kg/m3) = (kg/m.s2)/(kg/m3) = (m2/s2), and the flux phi is a volume flux rather than a mass flux. You can see this from the file headers in the 0 time folder of an icoFoam case ... check the dimensions. The pressure gradient term therefore has dimensions m/s2, as you point out.

Now turn to the discretised momentum equation - remember that this is integrated over each cell, and so each term in the discretised incompressible momentum equation has dimensions of m4/s. You can visualise this as Q.U where Q is the volume flow rate and U is the velocity added to that flow rate (ordinarily this would be mdot.U, for non-incompressible solvers).

Coming back to your question, with your approach and icoFoam, yes your source needs to be kinematic, ie divide through by density as per chemak's reply. No, you don't need to divide through by the cell volume ... although if you are applying a force spread over a number of cells, then it makes sense to calculate the specific value and then calculate the value for each cell based on its volume.
Divyaprakash likes this.
Tobermory is offline   Reply With Quote

Reply

Tags
density, icofoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
MapFields utility for staggered grid saeed jamshidi OpenFOAM Running, Solving & CFD 17 January 23, 2024 12:36
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 18:34
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 11:57
UDF Source Term Units? Brian FLUENT 1 October 24, 2005 10:15


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