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

is it possible to learn open foam and run simulations on an iron man suit in 2 weeks?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 11, 2023, 07:08
Unhappy is it possible to learn open foam and run simulations on an iron man suit in 2 weeks?
  #1
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
i have been given a 2-week deadline to come up with some results on analyzing flow behaviours on iron man and conduct a small study on its aerodynamic properties by experimenting with variable geometry designs and other such things

now im really lost as to what software to use since they all cost a pretty penny and im restricted to using my university in-house computers which are pretty good but i dont have access to them all the time.

OpenFoam seemed to be a good option since it's open source, but then i realized the steep learning curve. Im sufficiently decent when it comes to programming though i dont know C++ but only C. Will i be able to come up with enough quantifiable results by 2 weeks or is it hopeless? And If so are there software out there willing to give me a chance?
bored_bot is offline   Reply With Quote

Old   November 13, 2023, 09:27
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 701
Rep Power: 12
AtoHM is on a distinguished road
With no experience in OF? Its gonna be tough.
You might be able to build a stable setup from the tutorials (and some youtube-video maybe?), but studying several variants will require building quite some meshes manually, which is time-consuming work without further automation if you use the openfoam tools like snappyHexMesh. Its not impossible, though. If you are enrolled with a university, they usually have access to more user-friendly software (with GUI) like CFX or Fluent. That might be the better choice given the timeframe. Even then, expecting meaningful results from someone with few experience in that short span of time is ...
bored_bot likes this.
AtoHM is offline   Reply With Quote

Old   November 13, 2023, 11:07
Default
  #3
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
Hey thank you for replying, im not so well versed with the meshing. I do have an iron man suit stl file from grabcad that i plan on using and the geometry is quite complex.

my plan of action was using an example from openfoam (the motorcycle example) and then just putting in my model and praying that it would give me some result.

yes I've just recently gotten the green light to use my university's computer lab containing ansys and solidworks. I will try finding which ones the easiest. But a part of me wants to go all out and learn open foam and try to get something out of my simulation. Im a big fan of open source and i do enjoy working on the terminal. But i dont know a lick of C++ but only C. I am deeply interested in academia, so i think i will have to come in terms with open foam one day or another.

given the timescale, i think i will have to do the former for now.

Please do let me know if there are any tutorials that a newbie like me can follow. I know a thing or two in linux.
bored_bot is offline   Reply With Quote

Old   November 14, 2023, 03:23
Default
  #4
Senior Member
 
M
Join Date: Dec 2017
Posts: 701
Rep Power: 12
AtoHM is on a distinguished road
Good news regarding C++: you do not need to program stuff if you keep at the entry level with the default solvers. Even some advanced things are possible without programming.


Bad news: meshing is quite complex for OpenFOAM. Stl is a limited file format and its more than probable, that the stl you get from 3rd parties are not ready to use for meshing. You probably have to clean it put, remove some details that are not relevant, make regions to have advanced control for the meshing (you will need finer mesh for details, coarse mesh for flat faces). This can cause the stl to have holes (check the threads here about "watertight stl") which can cause the meshing to abort. That leads to the requirement of learning yet another tool like (Salome, Blender, ...) just to get a good stl in the first place. That's alot to do in two weeks. Not counting the hours the cases need to run.
AtoHM is offline   Reply With Quote

Old   December 4, 2023, 00:12
Default
  #5
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
okay so i have got the mesh with the help of a friend but unfortunately im unable to contact him at the moment,

the meshing comes with a domain and im unable to just isolate the iron man suit. I want to get pressure and velocity contour plots if anything.

this is the error i get whilst running potentialFoam on the mesh



--> FOAM FATAL IO ERROR: (openfoam-2306)
Size 160158 is not equal to the expected length 1280

file: 0/U.internalField at line 21.

From void Foam::Field<Type>::assign(const Foam::entry&, Foam::label) [with Type = Foam::Vector<double>; Foam::label = int]
in file /usr/src/packages/BUILD/src/OpenFOAM/lnInclude/Field.C at line 253.

FOAM exiting



how do i resize it? since i am running it of from the motorbike tutorial

here's the pictures to my mesh and my boundary file contents:

https://imgur.com/a/edJjsN5
bored_bot is offline   Reply With Quote

Old   December 4, 2023, 04:34
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
Hello,

This usually happens when there is a size mismatch between the 0 directory and the mesh.
It's not really possible to help you further without knowing your exact workflow. Do you have a run script showing all the commands you run? Is it the motorbike Allrun script?

Where is the boundary file you showed in your screenshot? In constant/polyMesh or in processor*/constant/polyMesh?

Yann
Yann is offline   Reply With Quote

Old   December 4, 2023, 07:11
Default
  #7
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
okay nevermind that, i have a new issue now lol

Check header is of the form:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
arch "LSB;label=32;scalar=64";
class IOobject;
location "constant/polyMesh/sets";
object nonOrthoFaces;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Mesh non-orthogonality Max: 80.5616594275 average: 8.5256679656
*Number of severely non-orthogonal (> 70 degrees) faces: 91.
Non-orthogonality check OK.
<<Writing 91 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
***Max skewness = 9.72019388748, 1 highly skew faces detected which may impair the quality of the results
<<Writing 1 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End



i got this after running checkMesha and im not so sure how i can fix this issue, any help would be appreciated
bored_bot is offline   Reply With Quote

Old   December 4, 2023, 07:20
Default
  #8
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
okay nevermind, still the same issue

Size 160158 is not equal to the expected length 431380


and yes, im using the motorbike allrun script, and yes my boundary file is located within the constant/polyMesh directory
bored_bot is offline   Reply With Quote

Old   December 4, 2023, 07:23
Default
  #9
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
you can run checkMesh with the -writeSets vtk option. it will write vtk files in a postProcessing directory. Loading these vtk files in ParaView will allow you to visualize which cells are in error.

The only way to fix it is to modify your mesh in the zones related to the error cells.
Yann is offline   Reply With Quote

Old   December 4, 2023, 08:01
Default
  #10
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
thanks for that, yeah i can see the cells that seem to be causing the issue. but ive kinda given up on remeshing it manually.

is there any way where i can circumvent this problem?

and btw i have a .msh file from fluent but unfortunately, i dont have any otherfiles pertaining to this.

So would i still be able to create a polyMesh from this using snappyHexMesh?
because the time i tried it, it spit out errors saying that i lacked the controlDict. What do i do from here?
bored_bot is offline   Reply With Quote

Old   December 4, 2023, 09:11
Default
  #11
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
Quote:
Originally Posted by bored_bot View Post
okay nevermind, still the same issue

Size 160158 is not equal to the expected length 431380


and yes, im using the motorbike allrun script, and yes my boundary file is located within the constant/polyMesh directory
Alright, what did you change in the Allrun script?
Because you cannot run the script as it is if you are converting a fluent mesh to OpenFOAM.

Quote:
Originally Posted by bored_bot View Post
So would i still be able to create a polyMesh from this using snappyHexMesh?
because the time i tried it, it spit out errors saying that i lacked the controlDict. What do i do from here?
For snappyHexMesh, you will need your geometry in STL or OBJ format.
Yann is offline   Reply With Quote

Old   December 4, 2023, 09:41
Default
  #12
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
Quote:
Alright, what did you change in the Allrun script?
Because you cannot run the script as it is if you are converting a fluent mesh to OpenFOAM.
yeah i gave up on that as well, for some reason even when i use my own mesh and use it in the motorbike tutorial, it still spits out the original mesh (the motorbike mesh) and idk how to fix this. and plus everytime i use fluentMeshToFoam or fluent3DMeshToFoam i get this error : missing file " .../system/controlDict" im not sure how to combat this since im literally just using the motorbike tutorial. sorry im a beginner.

And sorry for the earlier confusion, im not using Allrun.


Quote:
For snappyHexMesh, you will need your geometry in STL or OBJ format.
so i have the stl file and i did all the things that needed to be done. no errors but when i open it on parafoam, what i end up getting is nothing. Nothing shows up in my cuboid? what could this issue be. let me link my gdrive so you can get the stl file.

https://drive.google.com/file/d/1EH9...ew?usp=sharing

here you go
bored_bot is offline   Reply With Quote

Old   December 4, 2023, 10:00
Default
  #13
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
You can open the Allrun script to see what commands are used in order to run the tutorial.
Before trying to run your own case, you should understand the motorbike case setup (mesh, boundary conditions, etc...) in order to be able to adapt it to your case.

Quote:
Originally Posted by bored_bot View Post
so i have the stl file and i did all the things that needed to be done. no errors but when i open it on parafoam, what i end up getting is nothing. Nothing shows up in my cuboid? what could this issue be. let me link my gdrive so you can get the stl file.
Obviously you did something wrong at some point since it doesn't work, but it's not possible to say what since we don't know what you have done. Can you describe everything you've done?

This might give you some ideas about what information to give in order to get help: How to give enough info to get help
Yann is offline   Reply With Quote

Old   December 4, 2023, 12:11
Default
  #14
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
Quote:
Before trying to run your own case, you should understand the motorbike case setup (mesh, boundary conditions, etc...) in order to be able to adapt it to your case.
where can i exactly know what to change to fit my mesh? any online resources you know of? thank you.

Heres all the things i did:

1) copy everything from the motorBike tutorial
2) create a new folder under /constant called triSurface
3) add my .obj file to triSurface
4) performed blockMesh, no issues
5) performed surfaceFeatureExtract, no issues again
6) performed snappyHexMesh, no issues again
7) performed > touch open.foam ( since i dont have parafoam directly installed on my ubuntu on wsl)
8) opened paraform to view the file
9) here's what i got (ALL the log files included as well)

https://drive.google.com/drive/folde...H-?usp=sharing


i definitely think it has something to do with the domain size, but im not sure how to fix it through block mesh. but at the same time, my mesh doesn't seem to show up anywhere, so idk how to fix that as well.
bored_bot is offline   Reply With Quote

Old   December 4, 2023, 12:41
Default
  #15
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
Alright, this is a dimension issue. Your STL file is written in millimeters, but OpenFOAM works with meters so the coordinates in your STL file are interpreted as meters by OpenFOAM.
You can use surfaceTransformPoints to scale your geometry in order to get the proper size.

You can see it in your snappy log file:
Code:
Create time

Create mesh for time = 0

Read mesh in = 0 s

Overall mesh bounding box  : (-5 -4 0) (15 4 8)
Relative tolerance         : 1e-06
Absolute matching distance : 2.29783e-05

Reading refinement surfaces.
Read refinement surfaces in = 0.07 s

Reading refinement shells.
Refinement level 4 for all cells inside refinementBox
Read refinement shells in = 0 s

Setting refinement level of surface to be consistent with shells.
For geometry motorBike.obj detected 0 uncached triangles out of 21644
Checked shell refinement in = 0.06 s

Reading features.
Read edgeMesh motorBike.eMesh
    points      : 64932
    edges       : 64932
    boundingBox : (-3371.16 134.852 -260.806) (-2335.53 2361.61 205.806)
Regarding your workflow:

1 to 3 seems OK.
4: you need to make sure the mesh created by blockMesh has the proper size and position. It should encloses your STL file. If it doesn't, you will have to adjust the blockMeshDict file. To check this, your can open your mesh in ParaView using your open.foam file, then load your STL file and check if size and positions are correct.
5 and 6: you need to adjust surfaceFeatureExtractDict and snappyHexMeshDict to match your STL name, and possibly the refinement levels in snappyHexMeshDict
Yann is offline   Reply With Quote

Old   December 4, 2023, 12:52
Default
  #16
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
im really sorry, but you got spoon feed me here

so i basically have to go to the dict files for blockmesh, surfaceFeatureExctract, and snappyHexMesh and then change the boundaries to match my stl size? and to what refinement levels do i change it to?

is there any way i can automate this? i belive surfaceTransformPoints should do the trick no? and if so do you mind spelling out the parameters pls
bored_bot is offline   Reply With Quote

Old   December 4, 2023, 13:04
Default
  #17
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
No, for the size issue you just need to use surfaceTransformPoints in order to scale down your STL file. (surfaceTransformPoints -help to get help on the syntax)

Once it's done, open it in ParaView alongside the mesh created with blockMesh to see if the STL is enclosed in your mesh.

From there, you will see if you need to adjust things in the dict files.
You might find information in the documentation https://doc.openfoam.com/2306/ and/or user guide: https://www.openfoam.com/documentation/user-guide
Yann is offline   Reply With Quote

Old   December 4, 2023, 13:39
Default
  #18
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
ah man i think my brain got surgically removed while i was asleep or something

because i cant get to figure this scale thing out

do you mind helping me out with the syntax pls
bored_bot is offline   Reply With Quote

Old   December 5, 2023, 04:26
Default
  #19
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
You can look at the documentation, you will find information, examples, and link to tutorials using the command: https://doc.openfoam.com/2306/tools/...ansformPoints/
You will also get information on the command by typing surfaceTransformPoints -help in your terminal.

So in your case, coordinates in your STL are in millimeters but you want it in meters. So it would be something like that:
Code:
surfaceTransformPoint -scale 0.001 constant/triSurface/yourFile.stl constant/triSurface/yourFile_scaled.stl
Yann is offline   Reply With Quote

Old   December 5, 2023, 10:47
Default
  #20
New Member
 
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3
bored_bot is on a distinguished road
oh okay thanks, i did type in help and all that but i couldn't really find an example that displays the argument. But after seeing your code it makes intuitive sense. sorry for the trouble.

but now i have a different issue, even though the mesh is scaled down, it's not properly positioned. what steps can i take to resolve this?

https://imgur.com/a/rC3fQr2

yeah im not so sure how to setup my mesh within the boundary box
bored_bot is offline   Reply With Quote

Reply

Tags
meshing 3d, openfoam, programing, simulation cfd, softwares


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
SimpleFoam cannot open include file Marija OpenFOAM Running, Solving & CFD 1 October 28, 2020 11:35
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 12:32
[snappyHexMesh] Problem with parallel run of snappyHexMesh Lorenzo92 OpenFOAM Meshing & Mesh Conversion 5 April 15, 2016 05:12
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 19:45


All times are GMT -4. The time now is 13:29.