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

Transforming force vectors to scalars

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2017, 13:21
Default Transforming force vectors to scalars
  #1
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 9
Friendly is on a distinguished road
Hi,

I would like to transform my force vectors to scalars directly in OpemFOAM while solving. I am using the following lines in my controldict to get the force vectors:

Code:
forces_fixedWall
    {
        type forces;
        libs ("libforces.so");
        writeControl timeStep;
        writetInterval 1;
        patches (fixedWall); 
pname p;
Uname U;
        rhorhoInf;
        rhoInf 1; 
        CofR (0 0 0);
    }
What I want is the force normal to the surface as scalar without calculating it manually by using the dot product with the normal vector.

Does anyone know how to do it?


Greetings

Friendly
Friendly is offline   Reply With Quote

Old   December 13, 2017, 05:02
Default
  #2
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 19
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi,

Assuming that your fixedWall patch does not rotate, one option would be to change the localSystem_ value in the forces.C code, but that would require some code reading and testing...

Another simpler option, is to "hack" the drag coefficient by making it return the force values instead of the drag coefficient and feed it the direction(s) you are interested in as:
Code:
liftDir         (0 0 1);
dragDir         (1 0 0);
You can find drag coefficient examples in the following tutorials:
Quote:
./compressible/sonicFoam/RAS/nacaAirfoil/system/controlDict:66: dragDir (0.970839 0.239733 0);
--
./incompressible/pisoFoam/LES/motorBike/motorBike/system/controlDict:105: dragDir (1 0 0);
--
./incompressible/pisoFoam/LES/motorBike/motorBike/system/forceCoeffs:21: dragDir (1 0 0);
--
./incompressible/simpleFoam/motorBike/system/forceCoeffs:24: dragDir (1 0 0);
All you would need to do apart from setting the wanted drag direction is to ensure
Quote:
(Aref * magUInf^2 * rhoInf) / 2 = 1
and, obviously, test to ensure the formulas are those...

Hope this helps,
louisgag is offline   Reply With Quote

Reply

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
ActuatorDiskExplicitForce in OF2.1. Help be_inspired OpenFOAM Programming & Development 10 September 14, 2018 11:12
Ploting Drag Force Vectors camilo_costa Fluent UDF and Scheme Programming 3 September 29, 2014 15:26
Access raw field data (scalars, vectors) on mesh haakon OpenFOAM Programming & Development 3 September 25, 2012 10:01
Force can not converge colopolo CFX 13 October 4, 2011 22:03
Force vectors for drag during sweeping motion aamer FLUENT 0 April 18, 2011 08:17


All times are GMT -4. The time now is 23:09.