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

Forces in V1.6

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2010, 22:43
Default
  #41
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
Sigh, I just want to solve my simulation problems and get a correct result. It is right or wrong, you think....
sandy is offline   Reply With Quote

Old   April 10, 2010, 23:50
Default
  #42
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
Quote:
Originally Posted by jploz View Post
Hi Gonzalo,

no, the forces object supplied with OF 1.6 does not support multiphase flow. It uses the prescribed density "rhoInf" when calculating the viscous forces (as I already wrote here http://www.cfd-online.com/Forums/ope...ip-flow-2.html) which is obviously not correct in the case of compressible flow and flow involving more than a single incompressible phase. If you would use a constant density in such case your resulting viscous forces would differ a lot.

In order to fix this, you need to read the current density field and use that instead of the defined "rhoInf".

Good luck.
Jean-Peer
.

Wat ??

Last edited by sandy; April 14, 2010 at 08:37.
sandy is offline   Reply With Quote

Old   June 23, 2010, 02:29
Default
  #43
New Member
 
Adrien
Join Date: Apr 2010
Location: Australia
Posts: 1
Rep Power: 0
Adrien is on a distinguished road
To remove barckets in bash for a file called crap:

cat crap | sed s/\(//g | sed s/\)//g > crap_nobracket

For the Headers, I would just open remove and save (it is not elegant but easy...)

In Octave, to give it the format you want:

myFile = fopen('<FileName.txt>',"w");
fprintf(myFile,"(%f %f %f)\n",<Vector>);
fclose(myFile);
Adrien is offline   Reply With Quote

Old   June 25, 2010, 09:20
Cool
  #44
New Member
 
Petter Andreas
Join Date: Aug 2009
Location: Norway
Posts: 1
Rep Power: 0
petterab is on a distinguished road
Quote:
Originally Posted by g.redondo View Post
Hi all,

I was trying to include the density in the forces.C file and I found that there are already some lines regarding to it. Therefore I wonder if multi-phase is already supported in OF1.6.

If so, how should the controlDict entry be. If it doesn't support it, how should it be included? The most important line would be the following. I think it should be:

vectorField vf = (Sfb[patchi] & devRhoReffb[patchi])*rho.boundaryField()[patchi];

and it is:

vectorField vf = Sfb[patchi] & devRhoReffb[patchi]

has anyone fixed this?

Gonzalo
Does anyone know how to fix this for multiphase flow (e.g. interFoam) and does anyone have an updated force.C which accounts for variable density and viscosity/or instructions saying where to change the file force.C?

Any comments are highly appreciated

Thanx,

Andreas
petterab is offline   Reply With Quote

Old   July 26, 2010, 08:51
Default forces and monents in OF1.6
  #45
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16
Hrushi is on a distinguished road
I am trying to calculate torque generated by impellar using execFlowFunctionObjects.

Last edited by Hrushi; July 27, 2010 at 02:17.
Hrushi is offline   Reply With Quote

Old   July 27, 2010, 02:09
Default
  #46
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16
Hrushi is on a distinguished road
Hi Stephane,

I am also using MRFSimpleFoam OF1.6.
I am trying to calculate moment about x.y and z axis.
I get the following error:

Create time
Create mesh for time = 500
Time = 500
Reading phi
Reading U
Reading p
Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
}

Unknown function type Forces
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting

My controlDict is:
application MRFSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;

functions
{
forces
{
type Forces;
functionObjectsLibs ("libforces.so");
outputControl outputTime;
patches (Rushton_Turbine_5_To_WALL);
rhoNmae rhoInf;
rhoInf 1.0;
pName p;
Uname U;
log true;
CofR (0 0 0);
}
forceCoeffs
{
type forceCoeffs;
functionObjectsLibs ("libforces.so");
patches (Rushton_Turbine_5_To_WALL);
pName p;
Uname U;
rhoName rhoInf;
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
ARef 1;
}
};

What should I do to get the moments? Do I need to change anything else?

Regrads,
Hrushikesh
Hrushi is offline   Reply With Quote

Old   July 27, 2010, 03:12
Default
  #47
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hello,
try this !

-----------------

functions
(
forces
{
type forces;
functionObjectsLibs ("libforces.so");
patches (Rushton_Turbine_5_To_WALL);
rhoName rhoInf;
pName p;
Uname U;
rhoInf 1.0;
CofR (0 0 0);
outputControl timeStep;
outputInterval 1;
log true;
}
forceCoeffs
{
type forceCoeffs;
functionObjectsLibs ("libforces.so");
patches (Rushton_Turbine_5_To_WALL);
pName p;
Uname U;
rhoName rhoInf;
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
ARef 1;
}
);

-----------------
Regards,
Stephane.
openfoam_user is offline   Reply With Quote

Old   July 27, 2010, 03:25
Default
  #48
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16
Hrushi is on a distinguished road
Hi Stephane,

I have tried this. But it gives me following error.

Unknown function type Forces
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting
Hrushi is offline   Reply With Quote

Old   July 27, 2010, 03:36
Default
  #49
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
My controlDict is :

---------------------------------

application MRFSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 5000;
deltaT 1;
writeControl timeStep;
writeInterval 1000;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;

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

-------------------------------------------------
This controlDict (only calculate forces) works fine for me.
Warning : 'type forces;' not 'type Forces;'
Stephane.
openfoam_user is offline   Reply With Quote

Old   July 27, 2010, 03:56
Default
  #50
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16
Hrushi is on a distinguished road
I have tried your 2nd reply also.
Do we have to modify anything alse in our case directory like changes in 0..
I am still getting the same error:
Unknown function type forces
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting

Hrushikesh
Hrushi is offline   Reply With Quote

Old   July 27, 2010, 04:04
Default Forces in V1.6
  #51
Senior Member
 
NAVEEN.K.M
Join Date: Mar 2009
Location: Bangalore, Karnataka, india
Posts: 114
Rep Power: 17
naveen is on a distinguished road
hi Hrushikes,

try this to get the forces in OpenFOAM 1.6..

functions
(
forces
{
type forceCoeffs;
functionObjectsLibs ("libforces.so");
outputControl timeStep;
outputInterval 1;
patches
{
Rushton_Turbine_5_To_WALL
);
pName p;
Uname U;
log true;
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
ARef 1;
}
);

Regards

Naveen
NAL, Bangalore
naveen is offline   Reply With Quote

Old   July 27, 2010, 05:12
Default
  #52
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16
Hrushi is on a distinguished road
Hi Naveen,
I have tried the things you have mentioned. But the error still remains.

Unknown function type force_coeffs
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting

What do the 1st two lines of error mean?

regards
Hrushikesh
Hrushi is offline   Reply With Quote

Old   September 22, 2010, 08:30
Default
  #53
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 18
paka is on a distinguished road
Any update in that matter? I tried different approaches, I mainly followed the following post: http://www.cfd-online.com/Forums/ope...es-of15-8.html

I'm using OpenFOAM 1.7.1 and interFoam solver.

Have a great day everyone!
K
paka is offline   Reply With Quote

Old   September 22, 2010, 16:25
Default
  #54
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 18
paka is on a distinguished road
I also tried to use icoFoam solver. In both cases I do not get any force output, neither in the screen output, nor in any file format.
paka is offline   Reply With Quote

Old   September 23, 2010, 02:43
Default
  #55
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16
Hrushi is on a distinguished road
Quote:
Originally Posted by paka View Post
Any update in that matter? I tried different approaches, I mainly followed the following post: http://www.cfd-online.com/Forums/ope...es-of15-8.html

I'm using OpenFOAM 1.7.1 and interFoam solver.

Have a great day everyone!
K
Hi,
I am attaching my controlDict file here. This version of controlDict is working for me (OF 1.6).


application MRFSimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 1500;
deltaT 1;
writeControl timeStep;
writeInterval 10;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (Rushton_Turbine_5_To_WALL); // change to your patch name
pName p;
Uname U;
rhoName rhoInf;
rhoInf 1000;
CofR (0.16 0 0); //Origin for moment calculations
outputControl timeStep;
outputInterval 1;
}
}
Hrushi is offline   Reply With Quote

Old   September 23, 2010, 06:40
Default
  #56
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 18
paka is on a distinguished road
Hrushi,

Really, really appreciate your post. Your controlDict file worked perfectly fine. At the current moment I'm not sure what exactly made a trick, but it work.

Best,
K
paka is offline   Reply With Quote

Old   September 23, 2010, 06:56
Default
  #57
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 18
paka is on a distinguished road
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
paka is offline   Reply With Quote

Old   January 14, 2011, 18:17
Default drag & force over a cylinder patch
  #58
Member
 
s.rasoul_varedi
Join Date: Feb 2010
Posts: 82
Rep Power: 15
desert_1250 is an unknown quantity at this point
Send a message via Yahoo to desert_1250
Hi all of foamers
I hope that you are well.
I have one question:
I want to calculate dragCoefficient over a cylinder with 0.025 diameter with viscoelasticFluidFoam solver. ( I use Kubuntu, OF 1-5 decv) . I add the code below in controlDict file
application viscoelasticFluidFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 300;
deltaT 1e-5;
writeControl adjustableRunTime;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable yes;
adjustTimeStep on;
maxCo 0.8;
maxDeltaT 0.001;
functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
outputControl runTime;
outputInterval 1;
patches (cylinder); // change to your patch name
PName p;
Uname U;
rhoInf 803.87097; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
}
forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
outputControl runTime;
outputInterval 1;
patches (cylinder); //change to your patch name
PName p;
Uname U;
log true;
rhoInf 803.87097;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 0.036;
lRef 0.025;
Aref 0.025;
}
);
// ************************************************** *********************** //
, but when run it,after one step, this error appear :
Courant Number mean: 3.24445e-07 max: 5.10534e-06 velocity magnitude: 0.000421808
deltaT = 1.43997e-05
No valid model for viscous stress calculation.
From function forces::devRhoReff()
in file forces/forces.C at line 306.
FOAM exiting
*** glibc detected *** viscoelasticFluidFoam: double free or corruption (fasttop): 0x0902a378 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x52c591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0x52dde8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x530ecd]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x7b3741]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d )[0x78fc2d]
/usr/lib/libstdc++.so.6(_ZNSsD2Ev+0x4c)[0x79163c]
/usr/lib/OpenFOAM-1.5-dev/lib/libfiniteVolume.so(_ZN4Foam4wordD1Ev+0x1d)[0xcf2efd]
/lib/tls/i686/cmov/libc.so.6(+0x2f1bf)[0x4f01bf]
/lib/tls/i686/cmov/libc.so.6(+0x2f22f)[0x4f022f]
/usr/lib/OpenFOAM-1.5-dev/lib/libOpenFOAM.so(_ZN4Foam5error4exitEi+0x1f9)[0x3f5d2f9]
/usr/lib/OpenFOAM-1.5-dev/lib/libforces.so(_ZNK4Foam6forces10devRhoReffEv+0xf54)[0x65315f4]
/usr/lib/OpenFOAM-1.5-dev/lib/libforces.so(_ZNK4Foam6forces10calcForcesEv+0x32)[0x652c852]
.
.
.
======= Memory map: ========
00110000-0024a000 r-xp 00000000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024a000-0024b000 ---p 0013a000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024b000-0024d000 r--p 0013a000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024d000-0024e000 rw-p 0013c000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024e000-00410000 r-xp 00000000 00:10 16479 /usr/lib/OpenFOAM-1.5-dev/lib/libmeshTools.so
00410000-00413000 r--p 001c1000 00:10 16479 /usr/lib/OpenFOAM-1.5-dev/lib/libmeshTools.so
00413000-00415000 rw-p 001c4000 00:10 16479 /usr/lib/OpenFOAM-1.5-dev/lib/libmeshTools.so
00415000-00416000 rw-p 00000000 00:00 0
.
.
.
1) can u guide me What is the problem?
2) did I enter Aref number truly? how Lref ? ( my diameter cylinder is 0.025 & 2D)
3) If needed to complile forceCoeffs, can you tell me how complie it successfully?
Thank a lot, Rasoul
desert_1250 is offline   Reply With Quote

Old   March 26, 2011, 10:43
Default Hi
  #59
Member
 
s.rasoul_varedi
Join Date: Feb 2010
Posts: 82
Rep Power: 15
desert_1250 is an unknown quantity at this point
Send a message via Yahoo to desert_1250
can every one help me that how to solve this error when i want to calculate cd (drag coeff),

No valid model for viscous stress calculation.

From fuction forces::devRhoReff()
in file foeces/forces.C at line 306


i added the turbulence lib & related lib to the solver and compiled it but this error always appear the run is stoped

Best, Rasoul
desert_1250 is offline   Reply With Quote

Old   June 10, 2011, 11:44
Default
  #60
Member
 
The True
Join Date: Dec 2010
Posts: 80
Rep Power: 16
Eren10 is on a distinguished road
mine BC conditions for pressure is zeroGradient, so I do not know what the pressure is at the farfield. at default pRef is set to 0.

How can I specify the pRef at the freestream pressure ? I have just added this line : pRef -1000; But this did not change anything , apparantly it did not use this value. I am calculating Cl Cd..
Eren10 is offline   Reply With Quote

Reply


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
changes to forces in 1.6 linnemann OpenFOAM Running, Solving & CFD 0 July 30, 2009 09:49
Strange results from interFoam solution converges but sum of all forces not equal to zero nicasch OpenFOAM Running, Solving & CFD 0 April 15, 2008 03:01
2d foil pressure forces problem mayor FLUENT 4 December 1, 2003 04:57
viscous-pressure forces nico FLUENT 0 June 9, 2003 15:41
Valve Forces in CFdesign Mike Clapp Main CFD Forum 3 March 8, 2001 15:09


All times are GMT -4. The time now is 17:04.