|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#5 | |
New Member
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2 ![]() |
Quote:
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 |
||
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,169
Rep Power: 27 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#7 | |
Senior Member
M
Join Date: Dec 2017
Posts: 692
Rep Power: 12 ![]() |
My 2 cents: this seems to be a rocket in air at 203 m/s thats Ma = 0.6 and your solver is
Quote:
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. |
||
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2 ![]() |
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. |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
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 |