|
[Sponsors] |
is it possible to learn open foam and run simulations on an iron man suit in 2 weeks? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 11, 2023, 07:08 |
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 |
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? |
|
November 13, 2023, 09:27 |
|
#2 |
Senior Member
M
Join Date: Dec 2017
Posts: 701
Rep Power: 12 |
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 ... |
|
November 13, 2023, 11:07 |
|
#3 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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. |
|
November 14, 2023, 03:23 |
|
#4 |
Senior Member
M
Join Date: Dec 2017
Posts: 701
Rep Power: 12 |
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. |
|
December 4, 2023, 00:12 |
|
#5 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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 |
|
December 4, 2023, 04:34 |
|
#6 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28 |
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 |
|
December 4, 2023, 07:11 |
|
#7 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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 |
|
December 4, 2023, 07:20 |
|
#8 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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 |
|
December 4, 2023, 07:23 |
|
#9 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28 |
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. |
|
December 4, 2023, 08:01 |
|
#10 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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? |
|
December 4, 2023, 09:11 |
|
#11 | |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28 |
Quote:
Because you cannot run the script as it is if you are converting a fluent mesh to OpenFOAM. For snappyHexMesh, you will need your geometry in STL or OBJ format. |
||
December 4, 2023, 09:41 |
|
#12 | ||
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
Quote:
And sorry for the earlier confusion, im not using Allrun. Quote:
https://drive.google.com/file/d/1EH9...ew?usp=sharing here you go |
|||
December 4, 2023, 10:00 |
|
#13 | |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28 |
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:
This might give you some ideas about what information to give in order to get help: How to give enough info to get help |
||
December 4, 2023, 12:11 |
|
#14 | |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
Quote:
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. |
||
December 4, 2023, 12:41 |
|
#15 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28 |
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) 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 |
|
December 4, 2023, 12:52 |
|
#16 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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 |
|
December 4, 2023, 13:04 |
|
#17 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28 |
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 |
|
December 4, 2023, 13:39 |
|
#18 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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 |
|
December 5, 2023, 04:26 |
|
#19 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28 |
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 |
|
December 5, 2023, 10:47 |
|
#20 |
New Member
johnny simson
Join Date: Nov 2023
Posts: 18
Rep Power: 3 |
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 |
|
Tags |
meshing 3d, openfoam, programing, simulation cfd, softwares |
|
|
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 |