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

Simplefoam solved forces are strange

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By AtoHM

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2024, 21:19
Default Simplefoam solved forces are strange
  #1
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
Hello All : ) Happy weekend i hope

Ok, so i use the CFDOF workbench via freecad to do my cfd, however my question is not about freecad. Its about the strange forces being solved when i add the following to the controldict file based off of this pdf tutorial using openfoam and freecad. Page 18 of 19 https://github.com/opensimsa/opensim...ation/CFD/UAV2 :

functions
{
forces_all
{
type forces;
libs ( "libforces.so" );
patches
(
Wall_Rocket
);
rho rhoInf;
rhoInf 1.2;
log off;
writeControl timeStep;
writeInterval 1;
CofR ( 0 0 0 );
}
}

I then check the forces file and it says my rocekt was expierencing 2.6*10^1 in x direction.. I assume newtons?

If so, that is way way wrong. Using openrocket my total drag is 0.54 for the Cd which means a drag force of roughly 13500 newtons

Here is my entire controldict file

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application simpleFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

deltaT 1;

endTime 2000;

writeControl timeStep;

writeInterval 100;

purgeWrite 0;

writeFormat ascii;

writePrecision 15;

runTimeModifiable true;

functions
{
forces_all
{
type forces;
libs ( "libforces.so" );
patches
(
Wall_Rocket
);
rho rhoInf;
rhoInf 1.2;
log off;
writeControl timeStep;
writeInterval 1;
CofR ( 0 0 0 );
}
}

libs
(
// Needed for availability of porous baffle boundary in potentialFoam
#include "turbulenceLib"
);

functions
{
}


Am i supposed to add other stuff? what about CofR?? whats that?


and where does it tell me what the units are in?

Could a small flow domain cause bad force values?

Openrocket uses barrowman equations and alot of numerical methods based off of surface friction value, Reynolds numbers at a particular surface friction value, temp, etc etc etc and i trust openrocket values

thanks much for the help
Lt72884 is offline   Reply With Quote

Old   June 22, 2024, 09:26
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27
Yann will become famous soon enough
Hello Matt,

OpenFOAM uses SI units so forces are indeed in Newton.
CofR is the centre of rotation, which only affects moment values.

You can have a look here for more details: https://develop.openfoam.com/Develop...orces/forces.H

If you're strictly interested in the forces, then your function object seems fine, as long as you defined all the rocket patches in the patches(); list, and the proper density in rhoInf.

Regarding your values, it's hard to say with the information your provided.
Did your simulation converge? Does your flow look sane/realistic?

An issue with the domain or boundary conditions could probably cause issues, as well as a bad mesh.

Regards,
Yann
Yann is offline   Reply With Quote

Old   June 22, 2024, 13:00
Default
  #3
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
Well, for rhoinf, i was told to just leave it that way haha

For convergence, it happened after 60 iterations which was surprising. The simulation ran with no errors either.

As for the mesh, it is a good mesh and has no holes it. The main volume flow, is 100mm mesh and then a mesh refinement at the surface of the Rocket is 0.1, so 90% smaller in size.

The rocket is 1200mm in length and about 400mm from the fin tip to the other fin tip. The flow chamber is pretty small, 2000mm cubed. 4 walls, an inlet, and an outlet. Then a single boundary condition called wall_rocket which is where i selected the entire surface of the rocket and made it a wall. This is the patch in the forces.

Do i need a reference pressure and if so, i have been told the equation for that is (rho\2)*v^2 ie dynamic pressure.

Im still very new to all of this so im not sure what the issue could be.

Do you want me to attach the case and mesh case?

Thanks
Lt72884 is offline   Reply With Quote

Old   June 24, 2024, 03:31
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27
Yann will become famous soon enough
Hello Matt,

A 2m long domain for a 1.2m rocket sounds indeed VERY small.
Could you show a slice of your mesh in order to see the cells and velocity field?

What boundary conditions do you use on the domain?

When you say convergence happened after 60 iterations, what do you mean? Residual convergence? Have you checked forces convergence?

There is no need to set a reference pressure to get proper forces, just the density.
Yann is offline   Reply With Quote

Old   June 24, 2024, 11:29
Default
  #5
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Matt,

A 2m long domain for a 1.2m rocket sounds indeed VERY small.
Could you show a slice of your mesh in order to see the cells and velocity field?

What boundary conditions do you use on the domain?

When you say convergence happened after 60 iterations, what do you mean? Residual convergence? Have you checked forces convergence?

There is no need to set a reference pressure to get proper forces, just the density.
BC's:
Inlet is set to 203m/s
Outlet set to staic pressure
The 4 sides are set to walls no slip viscous

Yes, the residuals converege quickly, im guessing due to such a small flow domain?


Here are pictures of the mesh. You can see the outside domain is 100mm, then the surface mesh of the rocket on the inside. The second picture is of the surface mesh only.

thanks my friend
Attached Images
File Type: jpg surface mesh.JPG (26.1 KB, 5 views)
File Type: jpg inside mesh.JPG (76.2 KB, 4 views)
Lt72884 is offline   Reply With Quote

Old   June 25, 2024, 03:35
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27
Yann will become famous soon enough
Hello Matt,

Alright, have you checked your velocity field (for instance slicing your domain and plotting the velocity in ParaView) ? does it look sane?

Have you checked the force convergence ? (since you are writing forces at each time step, you can plot the force values and see if it converges)

Which solver are you using ?
Have you check your y+ values on the rocket?

You should probably start by running a case with a bigger domain.
Have a look there for some recommendations:
Computational domain size
The size of the computational domain

Have fun!
Yann
AtoHM likes this.
Yann is offline   Reply With Quote

Old   June 25, 2024, 05:10
Default
  #7
Senior Member
 
M
Join Date: Dec 2017
Posts: 692
Rep Power: 12
AtoHM is on a distinguished road
My 2 cents: this seems to be a rocket in air at 203 m/s thats Ma = 0.6 and your solver is
Quote:
SimpleFoam is a steady-state solver for incompressible, turbulent flow

AFAIK an incompressible flow can only be assumed up to Ma = 0.3. You might want to switch to https://openfoamwiki.net/index.php/RhoSimpleFoam for this.
Yann likes this.
AtoHM is offline   Reply With Quote

Old   June 25, 2024, 15:50
Default
  #8
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
In response to Yann and Atohm:

I did more testing last night and as i increased the flow domain to be 5 characteristic lengths LONGer than the rocket and only 1 length wider, the forces became more realistic. In fact, using potential flow and simplefoam, even with a 210m/s velocity, i got a 0.51 Cd which is very accurate to my openrocket software.

I have now done a case with HISA as well and at higher speeds, the drag does indeed increase and the flow in paraview looks great.

I think the issue was such a small flow domain.

Now my last question is, i keep getting informed by MANY users of openfoam, not on this forum, that pRef is indeed the dynamic pressure. So for all my tests i used 25 kPa and 28kPa as the value and adjusted rho based on launch area.

I then used hand calculations for surface friction, Re, and a bunch of other geometric relations to calculate the drag force and i get the same value within 3 units.

Last is the fatal error i was getting on another test. I made a separate thread for that.

Attached is an image from last night, late this morning.
Attached Images
File Type: jpg final results with equations.JPG (20.7 KB, 8 views)
Lt72884 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
Forces and Moments Given by forces Function Object are not Perpendicular Ship Designer OpenFOAM Post-Processing 1 February 6, 2022 23:32
interFoam vs. simpleFoam channel flow comparison DanM OpenFOAM Running, Solving & CFD 12 January 31, 2020 15:26
Pressure and density values to compute forces fernexda OpenFOAM Post-Processing 2 March 6, 2015 03:39
Forces from simpleFoam sture OpenFOAM Post-Processing 3 August 7, 2014 14:41
Valve Forces in CFdesign Mike Clapp Main CFD Forum 3 March 8, 2001 14:09


All times are GMT -4. The time now is 22:12.