# How to get forceDensity in OpenFOAM

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

 March 27, 2014, 14:24 How to get forceDensity in OpenFOAM #1 Member   Ye Zhang Join Date: Dec 2009 Location: Delft,Netherland Posts: 92 Rep Power: 16 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(fDName_); const fvMesh& mesh = fD.mesh(); const surfaceVectorField::GeometricBoundaryField& Sfb = mesh.Sf().boundaryField(); 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]/sA *( 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);

 May 7, 2020, 06:05 #2 New Member   Constance Clément Join Date: Nov 2018 Location: Paris Posts: 6 Rep Power: 7 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, Constance

 May 12, 2020, 14:14 #3 Senior Member     Herpes Free Engineer Join Date: Sep 2019 Location: The Home Under The Ground with the Lost Boys Posts: 932 Rep Power: 12 Hi, - I think the force density in forces.C is a force field per unit area [N/m2]. - Some related notions can be deduced from https://en.wikipedia.org/wiki/Force_density , I think. Hope it helps. __________________ The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror