|
[Sponsors] |
September 2, 2009, 12:35 |
Forces in V1.6
|
#1 |
Member
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17 |
Hi, I have updated from 1.5 to 1.6 (GIT source). I have modified some of my cases control files to get OpenFOAM 1.6 to work but I am having problems with forces in simpleFoam.
I get the error message: --> FOAM Warning : From function void forces::read(const dictionary& dict) in file forces/forces.C at line 277 Could not find U, p or rho in database. De-activating forces. --> FOAM Warning : From function void forces::read(const dictionary& dict) in file forces/forces.C at line 277 Could not find U, p or rho in database. De-activating forces. My controlDict force configuration is: functions ( forces { type forces; functionObjectLibs ("libforces.so"); outputControl outputTime; // Patches to sample patches (car_car); // Name of fields pName p; Uname U; // Dump to file log true; // Density rhoInf 1.17; // Centre of rotation CofR (0 0 0); } forceCoeffs { type forceCoeffs; functionObjectLibs ("libforces.so"); outputControl outputTime; // Patches to sample patches (car_car); // Name of fields pName p; Uname U; // Dump to file log true; // Density rhoInf 1.17; // Centre of rotation CofR (0 0 0); // Direction for lift liftDir (0.0 1.0 0.0); // Direction for drag dragDir (1.0 0.0 0.0); // Pitching axis pitchAxis (0 0 0); magUInf 13.0; lRef 2.5; Aref 0.296256; } ); Any one have any idea what is wrong ? |
|
September 2, 2009, 13:33 |
|
#2 |
Member
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17 |
Looking at the source code it looks like I need to add: "rhoName rhoInf;" to the "forces" and "forceCoeffs" entreis in controlDict or provide a "rho" initial conditions file in "0".
This appears to work ... |
|
September 19, 2009, 06:26 |
|
#4 |
Member
toto
Join Date: Jun 2009
Posts: 71
Rep Power: 17 |
could someone tell me the best way to simulate the Flow over a Cylinder?
Laminare, k-epsilon and k-omega! |
|
October 14, 2009, 10:09 |
|
#5 |
Senior Member
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18 |
Terry,
I am using MRFSimpleFoam - OpenFoam-1.6.x. I get the following message error : Starting time loop --> FOAM Warning : From function void forces::read(const dictionary& dict) in file forces/forces.C at line 278 Could not find U, p or rho in database. De-activating forces. My controlDict is : functions ( forces { type forces; functionObjectLibs ("libforces.so"); //Lib to load patches (object1); // 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; } ); How do I modify my controlDict file ? Regards, Stephane |
|
October 14, 2009, 10:22 |
|
#6 |
Member
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17 |
Hi,
You need to add: rhoName rhoInf; rhoInf 1.17; instead of: rhoName rho; rhoInf 1.225; //Reference density for fluid I think... Cheers Terry |
|
October 14, 2009, 10:24 |
|
#7 |
Member
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17 |
Obviously rhoInf should be set how you need it
|
|
October 14, 2009, 10:39 |
|
#8 |
Senior Member
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18 |
Thanks Terry,
Now it works fine ! One more question. And if I want to have the forces results like below (tail -f log) in the log file ? Courant Number mean: 0.000625962 max: 0.0181186 DILUPBiCG: Solving for Ux, Initial residual = 8.58271e-05, Final residual = 5.68736e-12, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 0.000135717, Final residual = 1.58931e-11, No Iterations 1 DICPCG: Solving for p, Initial residual = 0.000308555, Final residual = 2.98446e-06, No Iterations 6 DICPCG: Solving for p, Initial residual = 5.6599e-06, Final residual = 9.87842e-07, No Iterations 193 DICPCG: Solving for p, Initial residual = 1.97131e-06, Final residual = 8.93472e-07, No Iterations 1 DICPCG: Solving for p, Initial residual = 9.0792e-07, Final residual = 9.0792e-07, No Iterations 0 time step continuity errors : sum local = 9.67148e-15, global = -1.15687e-16, cumulative = -1.07021e-10 DICPCG: Solving for p, Initial residual = 9.19959e-07, Final residual = 9.19959e-07, No Iterations 0 DICPCG: Solving for p, Initial residual = 9.19959e-07, Final residual = 9.19959e-07, No Iterations 0 DICPCG: Solving for p, Initial residual = 9.19959e-07, Final residual = 9.19959e-07, No Iterations 0 DICPCG: Solving for p, Initial residual = 9.19959e-07, Final residual = 9.19959e-07, No Iterations 0 time step continuity errors : sum local = 9.79972e-15, global = -1.14472e-16, cumulative = -1.07021e-10 ExecutionTime = 25809.3 s ClockTime = 77462 s forces output: forces(pressure, viscous)((3.36459 -0.00234243 9.49148e-20) (0.365777 -2.56403e-05 -1.76832e-22)) moment(pressure, viscous)((3.41853e-19 -8.54044e-18 -0.00215479) (-8.87561e-22 1.48373e-20 0.0157578)) forceCoeffs output: Cd = 152.26 Cl = -0.0966561 Cm = -1.91544e-17 Time = 2.417 Stephane. |
|
October 14, 2009, 10:44 |
|
#9 |
Member
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17 |
Sorry, I am only a novice at this so I don't know how to do that.
You could try adding: log true; I'm not sure what that does ... |
|
November 3, 2009, 17:24 |
|
#10 |
New Member
Ted Brenner
Join Date: Oct 2009
Location: Oregon, WI
Posts: 12
Rep Power: 17 |
Hi,
Is there not a website or tutorial anywhere that gives some instructions for using the forces function? Does it really take digging through the source code? Any links or tips would be much appreciated! Thanks |
|
December 2, 2009, 08:54 |
|
#11 |
Member
Join Date: Sep 2009
Posts: 45
Rep Power: 17 |
Hi all,
I want to investigate the forces acting on a cylinder so I use the entry "forces" in the controlDict, It works well but in the file .dat I've got something like that: forces(pressure, viscous)((3.36459 -0.00234243 9.49148e-20) (0.365777 -2.56403e-05 -1.76832e-22)) moment(pressure, viscous)((3.41853e-19 -8.54044e-18 -0.00215479) (-8.87561e-22 1.48373e-20)) What does (pressure, viscous) mean ? I want to compute all the forces that is to say Fx,Fy,Fz. I can't see them anywhere in the data file... Is there something I'm missing? Thanks. |
|
December 2, 2009, 09:01 |
|
#12 |
Member
Terry Barnaby
Join Date: Mar 2009
Location: Beam Ltd, UK
Posts: 44
Rep Power: 17 |
As far as I know:
Pressure force is the force on the object due directly to pressure differences. Viscous force is the force due to the "friction" of the fluid passing over the objects surface. To get the total force acting on the object you need to add the pressure components to the viscous components. |
|
December 15, 2009, 11:45 |
Multi-phase
|
#13 |
New Member
GRD
Join Date: Jun 2009
Posts: 28
Rep Power: 17 |
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 |
|
December 16, 2009, 05:03 |
|
#14 |
Member
Jean-Peer Lorenz
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 33
Rep Power: 17 |
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 |
|
December 21, 2009, 06:53 |
|
#15 | |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 16 |
Quote:
anyone can help me? I'am trying to calculate the drag and lift on a cylinder with simplefoam..any advise? Thank you
__________________
|
||
December 21, 2009, 07:55 |
|
#16 |
Senior Member
|
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; } } Jose Santos |
|
December 21, 2009, 08:50 |
|
#17 | |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 16 |
Impressive
I have put in my controlDict file this code: Quote:
With regards
__________________
|
||
December 21, 2009, 11:04 |
|
#18 |
Senior Member
|
"My" code calculates both the forces and their coefficients ;-)
|
|
December 21, 2009, 11:27 |
|
#19 |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 16 |
Thank you, I tried and it works very well
__________________
|
|
February 23, 2010, 04:17 |
|
#20 |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 16 |
Hello to everybody,
I'm trying to remove the brackets and the header from forces.dat output file, any advise please? Thank you in advance
__________________
|
|
|
|
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 |