CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

forces and moment in slosing tank

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

Like Tree2Likes
  • 1 Post By musahossein
  • 1 Post By musahossein

Reply
 
LinkBack Thread Tools Display Modes
Old   February 12, 2010, 12:20
Default forces and moment in slosing tank
  #1
Member
 
angel
Join Date: May 2009
Location: Spain
Posts: 46
Rep Power: 8
anmartin is on a distinguished road
Hi to everybody
Iím trying to simulate sloshing inside a tank. The tank is excited laterally (Y) with a SKA (6DoF.dat) function that represent a sinusoidal excitation.
I would like to obtain the lateral and vertical forces and moment around X axis produced by the water inside to be compared with experimental data.
I will be very gratefully If someone can help me
Best regards,
anmartin is offline   Reply With Quote

Old   February 18, 2010, 15:35
Default forces and moment in slosing tank
  #2
Member
 
angel
Join Date: May 2009
Location: Spain
Posts: 46
Rep Power: 8
anmartin is on a distinguished road

I guess my posts must be really stupid, since they seem to never get answered.
Well, I am fully aware that OpenFOAM is open-source and that all replies and support is voluntarily and that of course nobody has any right to his or her problems being answered.
Still, I was hoping to get some support, especially since I am actually trying to validate OpenFOAM against some experimental data. I have done many test with differents tanks sections excitate with a sinusoidal displacement
in orden to optain a mechanical analogy that can be incorporate in an truck model, and now i will like to finish my phd thesis, with a foam simulation to completed the work done.

I have triyed to use interFoamPressure, but i have several error:
a)readEnvironmentalProperties.H is not present (It is possible to get from OF1.5)
b) -llduSolvers is not present (i have comment it in the file) and the compiled with wmake
c) when run interFoamPressure appears:
Not all fields are present.
pd gamma missing.

Anyway, I have read in the forum some cases where it is possible to obtain the forces by adding some functions at the end of the controlDict
(Forces in V1.6)
that i will try

I will be very gratefully If someone can help me
Best regards,
anmartin is offline   Reply With Quote

Old   January 29, 2012, 20:10
Default reading pressure from files
  #3
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Quote:
Originally Posted by anmartin View Post
I guess my posts must be really stupid, since they seem to never get answered.
Well, I am fully aware that OpenFOAM is open-source and that all replies and support is voluntarily and that of course nobody has any right to his or her problems being answered.
Still, I was hoping to get some support, especially since I am actually trying to validate OpenFOAM against some experimental data. I have done many test with differents tanks sections excitate with a sinusoidal displacement in orden to optain a mechanical analogy that can be incorporate in an truck model, and now i will like to finish my phd thesis, with a foam simulation to completed the work done.

I have triyed to use interFoamPressure, but i have several error:
a)readEnvironmentalProperties.H is not present (It is possible to get from OF1.5)
b) -llduSolvers is not present (i have comment it in the file) and the compiled with wmake
c) when run interFoamPressure appears:
Not all fields are present.
pd gamma missing.

Anyway, I have read in the forum some cases where it is possible to obtain the forces by adding some functions at the end of the controlDict
(Forces in V1.6)
that i will try

I will be very gratefully If someone can help me
Best regards,
Did you ever solve this problem? I am running sloshingTank2d. I have modified the controlDict file as required so that at each time increment OpenFoam outputs phase and pressure. My confusion is, since for each displacement value in the 6DoF.dat file, OpenFoam generates a bunch of pressure and phase, do I take the last file that is output for a particular displacement as the correct one, or do we need to check for some kind of convergence? Any suggestions would be greatly appreciated, Thanks.
Musa
musahossein is offline   Reply With Quote

Old   January 30, 2012, 19:58
Default
  #4
Member
 
angel
Join Date: May 2009
Location: Spain
Posts: 46
Rep Power: 8
anmartin is on a distinguished road
Quote:
Originally Posted by musahossein View Post
Did you ever solve this problem? I am running sloshingTank2d. I have modified the controlDict file as required so that at each time increment OpenFoam outputs phase and pressure. My confusion is, since for each displacement value in the 6DoF.dat file, OpenFoam generates a bunch of pressure and phase, do I take the last file that is output for a particular displacement as the correct one, or do we need to check for some kind of convergence? Any suggestions would be greatly appreciated, Thanks.
Musa
Hello,

I put this lines in my controldict and works perfectly.
functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (walls);
rhoName rhoInf;
rhoInf 998.2; //Reference density for fluid
CofR (0 -0.071 0.25); //Origin for moment calculations
outputControl outputTime;
}
}

You only need to set on turbulence and printCoeffs in constant/RASProperties
RASModel laminar; //or any other type of turbulence
turbulence on;
printCoeffs on;

best regards
anmartin is offline   Reply With Quote

Old   February 3, 2012, 22:22
Default
  #5
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
how can you tell if the force is from your fluid or atmosphere. I have done something similar in controldict, where I have openfoam ouput alpha (phase value) and the pressure. Now I have to write a code that will only give me the pressures from cells that have a phase less than zero, since I am interested in obtaining fluid pressures only on the left and right walls of a tank. My code in control dict 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;
}
);
}
musahossein is offline   Reply With Quote

Old   February 4, 2012, 08:43
Default
  #6
Member
 
angel
Join Date: May 2009
Location: Spain
Posts: 46
Rep Power: 8
anmartin is on a distinguished road
Hello,
In my case forces are for both air (alpha 0-0.5) and water (alpha>0.5). Try to multiply cell value by alpha.
With swak4foam wold be possible to do something similar.
In my controldict i fix write interval to 0.025 then with outputTime i obtain a force value every that time to compare with experimental data. You have one more line fixed outputinterval to 5.
anmartin is offline   Reply With Quote

Old   February 4, 2012, 11:22
Default
  #7
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Quote:
Originally Posted by anmartin View Post
Hello,

I put this lines in my controldict and works perfectly.
functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (walls);
rhoName rhoInf;
rhoInf 998.2; //Reference density for fluid
CofR (0 -0.071 0.25); //Origin for moment calculations
outputControl outputTime;
}
}

You only need to set on turbulence and printCoeffs in constant/RASProperties
RASModel laminar; //or any other type of turbulence
turbulence on;
printCoeffs on;

best regards
I copied the above into my controlDict file for sloshingTank2D. When I ran it, I got the following complaint in the log.interDyMFoam file as follows:

--> FOAM FATAL IO ERROR:
keyword nu is undefined in dictionary "/home/musa/OpenFOAM/musa-2.0.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/transportProperties"

file: /home/musa/OpenFOAM/musa-2.0.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/transportProperties from line 23 to line 35.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting

But I have defined nu in the transport properties file as follows:
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Phase1 is water; phase2 is air. Values for Standard Temperature and pressure (0 deg C, 14.69 psi
// or 101.325 kPa, ) in accordance with NIST
//

phase1
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 998.2;
}

phase2
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.50e-05;
rho rho [ 1 -3 0 0 0 0 0 ] 1.2;
}

sigma sigma [ 1 0 -2 0 0 0 0 ] 0;


// ************************************************** *********************** //

I have set turbulence as laminar as I am not expecting any wave breaking or huge amount of sloshing. Could that be the problem?

Any advice would be greatly appreciated.
musahossein is offline   Reply With Quote

Old   February 4, 2012, 14:20
Default
  #8
Member
 
angel
Join Date: May 2009
Location: Spain
Posts: 46
Rep Power: 8
anmartin is on a distinguished road
Hello,


libforces need to set any turbulence model, but in OF tutorial appears that laminar is a dummy turbulence model, then you only need to set on turbulence properliey:

In tubulenceProperites file
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;

In RASProperites file
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel laminar;
turbulence off;
printCoeffs on;
As I mentioned you in the previously, set on printCoeffs in constant/RASProperties and
RASModel laminar; //or any other type of turbulence
turbulence on;
printCoeffs on;

best regards
anmartin is offline   Reply With Quote

Old   August 5, 2013, 10:22
Default
  #9
New Member
 
Basta
Join Date: Jul 2013
Posts: 28
Rep Power: 4
mina.basta is on a distinguished road
Dear all,

I add this section in my controlDict:

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (stlSurface_ascii); // change to your patch name
pName p;
Uname U;
rhoName rho;
rhoInf 1.225; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
outputControl timeStep;
outputInterval 1;
}
);

but I still don't know how to visualize the force or moment in paraview? Could you help me ?

Best regards,

Mina
mina.basta is offline   Reply With Quote

Old   August 5, 2013, 10:29
Default
  #10
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
As far as I know, paraview can only work with data that has been written to disk and forcesCoeffs-functionObject doesn't write it to disk so you many not be able to visualize the forces. At least I have not seen that functionality in paraView. If you find a solution, let me know.
musahossein is offline   Reply With Quote

Old   August 5, 2013, 10:33
Default
  #11
New Member
 
Basta
Join Date: Jul 2013
Posts: 28
Rep Power: 4
mina.basta is on a distinguished road
Dear musaddeque hossein,

So, do you have another solution to calculate the average force or moment on a surface ? I know well that the pressure is distrubed on a surface but i want an average value for a force & where can be this average force located? Is it possible using OF and paraView?

Best regards,
Mina
mina.basta is offline   Reply With Quote

Old   August 5, 2013, 10:41
Default
  #12
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
One thing you can do is to write a script or code (I use fortran) that can read the pressure files that OF generates and then compile the forces from there. I have done that, but only for pressures in sloshingTand2D problem to capture the forces against the walls of the tank.
musahossein is offline   Reply With Quote

Old   August 5, 2013, 10:44
Default
  #13
New Member
 
Basta
Join Date: Jul 2013
Posts: 28
Rep Power: 4
mina.basta is on a distinguished road
Thanks a lot but I read something in http://www.cfd-online.com/Forums/ope...-parafoam.html
What do you think ?
mina.basta is offline   Reply With Quote

Old   August 5, 2013, 10:50
Default
  #14
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
You can try the steps that were outlined. But if you know some programming, then instead of doing each step manually as the poster has stated, you can run your code and generate the data you seek.
mina.basta likes this.
musahossein is offline   Reply With Quote

Old   August 27, 2013, 17:43
Default
  #15
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Quote:
Originally Posted by mina.basta View Post
Dear all,

I add this section in my controlDict:

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (stlSurface_ascii); // change to your patch name
pName p;
Uname U;
rhoName rho;
rhoInf 1.225; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
outputControl timeStep;
outputInterval 1;
}
);

but I still don't know how to visualize the force or moment in paraview? Could you help me ?

Best regards,

Mina
You have an error in your code. rhoName should be set to rhoInf and not rho.
mina.basta likes this.
musahossein is offline   Reply With Quote

Old   August 29, 2013, 08:31
Default output from libforces.so
  #16
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
Dear all:

I have the following code in controlDict for sloshingtank2D in Interdymfoam:

forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
outputControl outputTime;
patches (leftWall rightWall);
pName p;
UName U;
rhoName rhoInf;
rhoInf 998.2; //Reference density for fluid
nuInf 1e-06;
CofR (0 0 0); //Origin for moment calculations

outputControl timeStep;
outputInterval 1;
}

The output is shown below. Looking at the output, there seems to be only 1 value for force for each time. But in controldict I specified the leftwall and rightwall -- so there should be two force outputs? Can anyone clarify this for me? Thankyou.

# Time forces(pressure, viscous, porous) moment(pressure, viscous, porous)
0.00116279 ((0 6.80759 0),(1.97145e-16 0.000111794 4.4025e-08),(0 0 0)) ((1.61118 0 0),(2.07113e-05 9.32239e-17 -4.15186e-17),(0 0 0))
0.00251938 ((0 12.3413 0),(3.27553e-17 0.00033949 -5.79995e-07),(0 0 0)) ((2.92001 0 0),(6.70143e-05 2.88232e-17 5.96196e-17),(0 0 0))
0.00410207 ((0 11.8477 0),(-1.40002e-16 0.000578923 -8.757e-07),(0 0 0)) ((2.80189 0 0),(0.000123266 -3.9136e-17 -6.36765e-17),(0 0 0))
0.00593798 ((0 11.2883 0),(8.41123e-17 0.000831158 -7.59491e-07),(0 0 0)) ((2.66847 0 0),(0.00018915 3.28012e-17 1.44194e-16),(0 0 0))
0.00814109 ((0 10.42 0),(-2.99483e-16 0.00110036 -1.08114e-06),(0 0 0)) ((2.46207 0 0),(0.000264889 -1.0025e-16 -6.09408e-17),(0 0 0))
musahossein is offline   Reply With Quote

Old   August 30, 2013, 22:47
Default
  #17
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 307
Rep Power: 9
musahossein is on a distinguished road
For those who are interested, the force in the first parenthesis is the resultant force. So the resultant does not have to be computed from the leftwall and rightwall force.
musahossein is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forces calulated through pressure LVDH OpenFOAM Post-Processing 2 February 26, 2010 04:15
Extracting the different Two Phase forces challenger85 CFX 3 February 3, 2010 05:00
Problems With Journal When Writing Forces To File Andrew FLUENT 2 September 23, 2005 02:12
CEL Function for moment acting on a BC? NymphadoraTonks CFX 4 November 10, 2004 18:01
viscous moment Thierry FLUENT 0 April 8, 2003 05:43


All times are GMT -4. The time now is 16:48.