CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Forces in V1.6 (https://www.cfd-online.com/Forums/openfoam-post-processing/67984-forces-v1-6-a.html)

Eren10 June 14, 2011 12:27

I have to change the pRef value to calculate the forces.

I am adding this statement to functions forces: pRef 1000; This does not change anything in values, it looks like it is invariant to the pRef value. How can I adapt the pRef value :confused:

Eren10 June 16, 2011 08:39

The flow field looked oke but given Cl value was not oke. So, I decided to calculate the Cl value by sampling pressure values. I get, Cl = 0.166, which looks oke , for airfoil at 0 angle of attack. ( I have not calculated shear stress, don't know how to do it yet. For now I assume it is small, icoFoam)

The OpenFoam gives these value:

Cl = 0.00166316;
Cd = 0.0000724

Strange, I see it now, it looks like Cl and Cd is missing a multiply with 100 :eek:

Eren10 June 21, 2011 11:08

Still I haven't been able to specify the pRef value :o

I have tried this in the controlDict file, to calculate force coefficients: pref pRefPoint (x y z);

but openfoam doesn't see pRefPoint(x y z) as a scalar

I get this error: wrong token type - expected Scalar

gascortado September 8, 2011 16:22

Hi,

I would like to be able to take a look at the libforces.so file to understand how it calculate the forces and eventually modify the library. Does anyone knows how to do that?

Thanks

gascortado September 16, 2011 17:13

This thread http://www.cfd-online.com/Forums/ope...tml#post324445 is related to force calculations. Does any one know the answer? Thanks

musahossein February 3, 2012 21:37

Quote:

Originally Posted by santos (Post 240633)
Hi,

Put something like this in your system/controlDict, changing accordingly to your situation:

Code:

functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (sphere_region0); // change to your patch name
rhoName rhoInf;
rhoInf 1000; //Reference density for fluid
CofR (2 0 0); //Origin for moment calculations
        outputControl  timeStep;
        outputInterval  1;
}
forceCoeffs
{
// rhoInf - reference density
// CofR - Centre of rotation
// dragDir - Direction of drag coefficient
// liftDir - Direction of lift coefficient
// pitchAxis - Pitching moment axis
// magUinf - free stream velocity magnitude
// lRef - reference length
// Aref - reference area
type forceCoeffs;
functionObjectLibs ("libforces.so");
patches (sphere_region0);
rhoName rhoInf;
rhoInf 1000;
CofR (2 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 1);
magUInf 1e-7;
lRef 0.06; // sphere diameter
Aref 0.0014137; //1/2 * projected area = pi*rē/2

        outputControl  timeStep;
        outputInterval  1;
}

}

Regards,
Jose Santos

Santos: I am running OpenFOAM 2.0.1. sloshingTank2D in interDyMFoam. I have rectangular tank half filled with water. Is there a quick way of getting the forces imparted by the fluid on the tank walls as the tank moves back and forth? I have some code in control dict that dumps cell alpha values and the corresponding pressure values into files that I have to extract and read.The only way I see of accomplishing this is first recording the cells that have alpha values of less than 1 indicating that the cell has fluid. Then look up the pressure in the cell. Then compute the force due to the pressure. is there a work around this so that I can, for example get the force due to fluid pressure on the left wall (or right wall) of the tank? What I am using right now is as follows:
wallPressure
{
type surfaces;
functionObjectLibs ("libsampling.so");
outputControl outputTime;
outputInterval 5;
surfaceFormat raw;
interpolationScheme cell;

fields ( alpha1
p
);
surfaces
(
leftwalls
{
type patch;
patches (leftWall);
interpolate true;
triangulate false;
}
rightwalls
{
type patch;
patches (rightWall);
interpolate true;
triangulate false;
}
);
}

Eren10 March 20, 2012 06:00

Hi,

I have used for mine new simulation the solution of old case. Only the angle of attack ( so velocity and lift and drag coefficients ) is changed. The simulations went oke, however the calculated lift and drag coefficients are wrong. If I sample the pressure coefficients than I get the correct Cl , Cd values however not exact as I want. Because of the many simulations I do not want to run them all again. Is there any solution for this issue ?

Is it possible to calculate the aerodynamic coefficients just based on the last time step ?

musahossein May 10, 2012 09:13

Wall pressures in InterDyMFoam
 
2 Attachment(s)
Dear all:
I am simulating a small 2D tank with dimensions 8m long, 5m high and 0.01m in depth. I am subjecting the tank to a sinusoidal displacement only and have modified the controlDict to provide wall pressures for the left and right walls at every 0.02 secs. In my opinion, if I am supplying a sinusoidal displacement, the pressures should also be sinusoidal. However when I plot the pressures corresponding to fluid phase in the left and right walls, I get what looks like a very choppy representation, which does not make sense. Any help or advice on how to fix this would be greatly appreciated, Thanks. I have attached the input plot and the pressure plot.

My mesh size is 200x200x1

FabioFobia October 17, 2012 12:54

IRef Aref------> BI ELEMENT AIRFOIL
 
One question: If I had a bi element airfoil (main&flap), I put in the patches the name of the two walls (main, flap), but for lRef e Aref I need to put 2 different values because the main airfoil and the flap have different chord and so different area. Help me please

pechwang November 11, 2013 11:16

Hi Petter,

I know this is an old thread. But I want to know whether you have found a way to calculate the multi-phase torque? Right now I'm using interFoam as well. And I'm stuck with the multi-phase torque calculation. If you have any updates, please let me know. Thank you very much.

Penghcuan

musahossein November 17, 2013 09:09

Is there some way to introduce fluid / wall friction? I am running sloshingtank2d in interdymfoam. The sloshing I get goes on as long as the simulation continues. How can I introduce wall friction so that the sloshing will slowly dissipate once the displacement stops?

pizicai July 8, 2014 10:42

Hello, Santos,

I have confusions about the value of rhoInf, in this thread, different values appeared, e.g. 1.17, 1.225 and 1000. This difference confuses me.

Thanks for your attention.

HosseinB September 2, 2015 16:49

Quote:

Originally Posted by paka (Post 276277)
I know the tool is not fully suitable for two-phase flows, but assuming that I only care for water domain (not air) I assume the tool gives acceptable solution.

So trying to use interFoam solver, the solver quits saying it cannot find "nu" in constant/transportProperties. I tried to redefine the code in forces.C, but for now I gave up. I found some work around, to add additional line at the beginning of transportProperties such as:

nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;

Can any of OpenFOAM gurus comment on that? Is such work around acceptable? I think the other two nu-s in phase1 and phase2 are read correctly by the solver.

Thanks,
K

Hi Paka,

Could you find out if your nu nu ... approach at the top of the transport properties file is a valid workaround for the problem? Just FYI: for the turbulent interFoam, there is no problem in the force calculations, but the problem exists when using laminar interFoam. This problem is "solved" when I take your approach but I am not sure if it is a correct way of tackling this problem. I am using 221 version.

Cheers,
Hossein


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