CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to get forceDensity in OpenFOAM

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

LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2014, 14:24
Default How to get forceDensity in OpenFOAM
Ye Zhang
Join Date: Dec 2009
Location: Delft,Netherland
Posts: 92
Rep Power: 16
kiddmax is on a distinguished road
Dear all,

I see the sorce code of force.C. There is forceDensity fD, my question is how to get this in OF??

Thank you!
Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const
forcesMoments fm
pressureViscous(vector::zero, vector::zero),
pressureViscous(vector::zero, vector::zero)

if (directForceDensity_)
const volVectorField& fD = obr_.lookupObject<volVectorField>(fDName_);

const fvMesh& mesh = fD.mesh();

const surfaceVectorField::GeometricBoundaryField& Sfb =

forAllConstIter(labelHashSet, patchSet_, iter)
label patchi = iter.key();

vectorField Md
mesh.C().boundaryField()[patchi] - coordSys_.origin()

scalarField sA(mag(Sfb[patchi]));

// Normal force = surfaceUnitNormal * (surfaceNormal & forceDensity)
vectorField fN
Sfb[patchi] & fD.boundaryField()[patchi]

fm.first().first() += sum(fN);
fm.second().first() += sum(Md ^ fN);

// Tangential force (total force minus normal fN)
vectorField fT(sA*fD.boundaryField()[patchi] - fN);
kiddmax is offline   Reply With Quote

Old   May 7, 2020, 06:05
New Member
Constance Clément
Join Date: Nov 2018
Location: Paris
Posts: 6
Rep Power: 7
ConstanceC is on a distinguished road
Hi kiddmax,

Did you find a solution to your problem ? I am also wondering what is this force density in OF. I want to determine the normal/tangential force on a structure but I need to give the name of this force density in controlDict when using the lib "libforces".

Thanks for your help,

ConstanceC is offline   Reply With Quote

Old   May 12, 2020, 14:14
Senior Member
HPE's Avatar
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road

- I think the force density in forces.C is a force field per unit area [N/m2].
- Some related notions can be deduced from , I think.

Hope it helps.
HPE is offline   Reply With Quote


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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 11:58
OpenFOAM Foundation Releases OpenFOAM v2.3.0 opencfd OpenFOAM Announcements from OpenFOAM Foundation 3 December 23, 2014 03:43
Problem installing OpenFOAM 1.5 installation on RHEL 4. vwsj84 OpenFOAM Installation 4 April 23, 2009 04:48
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
OpenFOAM Training and Workshop Hrvoje Jasak Main CFD Forum 0 October 7, 2005 07:14

All times are GMT -4. The time now is 12:39.