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

how to run motorBike with 2 cores

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By boffin5
  • 1 Post By boffin5

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 26, 2021, 12:56
Default how to run motorBike with 2 cores
  #1
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
After trying to make setup changes for 2 cores, and running the motorBike, I get these results:
- snappyhexmesh works fine.
- if I try to run potentialFoam, I get a 'no MRF file' error
- when not running potentialFoam, but just running simpleFoam, it runs much too quickly, but finishes.
- then, in paraview, it only goes up to time step 3, and there is no p or U data.


Basically, the question is: which setup files need to be adjusted to account for just 2 cores? I thought I knew, but obviously not.
boffin5 is offline   Reply With Quote

Old   March 26, 2021, 16:27
Default
  #2
New Member
 
erickmartinez's Avatar
 
Erick D. Martinez
Join Date: Oct 2020
Location: Texas
Posts: 29
Rep Power: 5
erickmartinez is on a distinguished road
Can you share your "Allrun" script you are using and the decomposeParDict and controlDict file scripts?
erickmartinez is offline   Reply With Quote

Old   March 27, 2021, 04:08
Default reply to Erick
  #3
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
Thanks Erick,
Here is my command sequence:
-cp motorBike.obj.gz into trisurface
-surfaceFeatures
-blockMesh
-decomposePar
-snappyHexMesh (should this be in parallel?)
-mpirun -np 2 potentialFoam -noFunctionObjects -parallel (gives 'no MRF files' message)
-mpirun -np 2 simpleFoam -parallel (quit here because it ran too fast)

controlDict file:
application simpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
functions
{ #include "streamLines"
#include "cuttingPlane"
#include "forceCoeffs" }


decomposeParDict file:
numberOfSubdomains 2;
method simple;
simpleCoeffs {
n (2 1 1);
delta 0.001; }


Thanks, I am open to (actually desparate for) suggestions!
boffin5 is offline   Reply With Quote

Old   March 27, 2021, 17:31
Default
  #4
New Member
 
erickmartinez's Avatar
 
Erick D. Martinez
Join Date: Oct 2020
Location: Texas
Posts: 29
Rep Power: 5
erickmartinez is on a distinguished road
Does the case run normally if ran with a single processor? If you would like to share a link to your files I can check it out. It just seems like a small mistake somewhere. If it works well with a single processor then there is an issue with the decomposition and running in parallel.
erickmartinez is offline   Reply With Quote

Old   March 29, 2021, 03:34
Default
  #5
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,095
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by boffin5 View Post
Thanks Erick,
Here is my command sequence:
-cp motorBike.obj.gz into trisurface
-surfaceFeatures
-blockMesh
-decomposePar
-snappyHexMesh (should this be in parallel?)
-mpirun -np 2 potentialFoam -noFunctionObjects -parallel (gives 'no MRF files' message)
-mpirun -np 2 simpleFoam -parallel (quit here because it ran too fast)
Yes, snappyHexMesh sould be run in parallel OR you should decompose your domain after running snappyHexMesh.

With this workflow you are basically running simpleFoam on your blockMesh mesh, which is probably why it is quite fast!


Cheers,
Yann
Yann is offline   Reply With Quote

Old   March 30, 2021, 17:01
Default
  #6
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
Erick, I sent you a private message with a dropbox link. Thanks for the help!
boffin5
boffin5 is offline   Reply With Quote

Old   March 31, 2021, 03:33
Default
  #7
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,095
Rep Power: 26
Yann will become famous soon enough
Hello Boffin5,

I suggest you to post here rather than sending private messages in order to share your findings with the community.

You have to use the "-overwrite" option with snappyHexMesh if you want to overwrite the original mesh (from blockMesh) with the new mesh generated by snappyHexMesh.

If you don't use the -overwrite option, snappyHexMesh will write the meshes in new time directories. It write 3 meshes corresponding to the 3 major steps of the mesh generation: castellated, snap and addLayers. You will have to manually copy the final mesh in (processor*/)constant/ in order to replace the original mesh and to run your solver on your final mesh.

Cheers,
Yann
Yann is offline   Reply With Quote

Old   March 31, 2021, 22:17
Default thanks Yann and Erick
  #8
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
Yann informed me that I had made 2 errors: I need to run snappyHexMesh in parallel, and and I also need to add the -overwrite flag. Now the motorBike case runs awesome! Thanks for the help, Yann. Also thanks to Erick Martinez for volunteering to help.



I had resorted to private messages, because when I tried to put screen captures of my files in the post, I kept exceeding the post size limit.
But I see lots of posts with really big file images, so there must be a way to do it.


Any ideas on that would be appreciated as well.
Yann likes this.
boffin5 is offline   Reply With Quote

Old   April 1, 2021, 12:12
Default motorBike.obj glitch?
  #9
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
Well, maybe I spoke too soon.


Yesterday I was chuffed that I was finally able to run the motorBike case;
today I tried to run it again, snappyHexMesh went fine, but when I entered the command
mpirun -np 2 potentialFoam -noFunctionObjects -parallel
it came back with the failure message:


cannot find patchField entry for motorBike_frt-fairing


This is after I coped the motorBike.obj.gz file from the tutorials/resources/geometry folder.


Could it be that the tutorial file has become corrupted?
boffin5 is offline   Reply With Quote

Old   April 1, 2021, 12:36
Default
  #10
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,095
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by boffin5 View Post
cannot find patchField entry for motorBike_frt-fairing

This means there is a boundary condition missing for the patch motorBike_frt-fairing in one of the file (if not all) in processor*/0/


This should not be related to the copy of motorBike.obj.gz file from the tutorials/resources/geometry folder but to something else in the workflow. Did you clean up the case before running it again?


Cheers
Yann
Yann is offline   Reply With Quote

Old   April 1, 2021, 13:42
Default debug files
  #11
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
Yes, I cleaned it. Here are the U files that resulted from snappyhexmesh-parallel, including the error file that comes after running potentialFoam.
btw, my command list:
surfaceFeatures
blockMesh
decomposePar
mpirun -np 2 snappyHexMesh -np 2 -overwrite -parallel
mpirun -np 2 potentialFoam -np2 noFunctionObjects -parallel


The error message refers to all the boundary condition lines in the U files, but I don't know how to interpret.



This is confounding, since today's procedure was identical to the one that was successful yesterday.


Yann, thanks for your help to date, and I hope can help again with this one!
Attached Images
File Type: png potentialFoam-error-msg.png (78.7 KB, 9 views)
File Type: png processor1-U.png (23.4 KB, 9 views)
File Type: png processor0-U.png (24.0 KB, 6 views)
File Type: png constant-0-U.png (32.4 KB, 6 views)
boffin5 is offline   Reply With Quote

Old   April 2, 2021, 03:39
Default
  #12
New Member
 
Dominik Mütter
Join Date: Mar 2021
Location: Europe
Posts: 4
Rep Power: 5
DominikMuetter is on a distinguished road
Quote:
The error message refers to all the boundary condition lines in the U files, but I don't know how to interpret.

This means that the boundary conditions for motorBike_frt-fairing are missing in the velocity dictionary, specification is done like with all the others (inlet, outlet, lowerWall etc.).

Example (NOT! the correct code):
boundaryField
{
...
motorBike_frt-fairing
{
type movingWallVelocity;
value $internalField;
}
...
}


I hope this is a helpful answer
DominikMuetter is offline   Reply With Quote

Old   April 2, 2021, 03:40
Default
  #13
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,095
Rep Power: 26
Yann will become famous soon enough
The boundary conditions related to the motorbike geometry are missing in your U file, this is what the solver complains about: there is not boundary condition defined for "motorBike_frt-fairing" hence the solver cannot run. You will have the same problem with every patch related to the motorbike geometry since they are all missing in your U file (as well as for the other variable files)

Have a look at the processor*/constant/polyMesh/boundary file. You will find there all the boundaries in your domain and of course, all boundaries need a boundary condition.

By default, if a 0 directory exists, decomposePar will decompose the fields according to the current mesh. When you run blockMesh then decomposePar, it will decompose only the boundary conditions related to the initial blockMesh and nothing related to the motorbike geometry since it does not exist yet in the mesh. This is why you get this error.

Check the original Allrun file in the motorbike tutorial to find how to solve this error. Depending on the OpenFOAM version you are using, it can be either "decomposePar -copyZero" (OpenFOAM 8) or "restore0Dir" (OpenFOAM v2012)

Cheers
Yann
Yann is offline   Reply With Quote

Old   April 2, 2021, 11:29
Default found the problem (I think)
  #14
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
Yes Yann,
I checked the Allrun file, and saw that decomposePar has -copyZero after it.
When I tried it this way, the darn thing ran okay!
Note to self: always heed the Allrun file!
I am cautiously optimistic, since I have seen that results can be unpredictable, and am looking forward to escaping the newbie phase, to grapple with more challenging foulups!
Yann likes this.
boffin5 is offline   Reply With Quote

Old   April 4, 2021, 13:00
Default
  #15
Senior Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 7
Ship Designer is on a distinguished road
Hi Alan,

I suggest to run decomposePar always with the -force option. This will ensure that you don't need to delete the processorN files manually but even more importantly, that nothing is left over from previous runs which might cause errors or unexpected results. When you run decomposePar -force, it will first delete all the processorN folders you might have in your case and then it will proceed to decompose first the polyMesh and then the field files, including the 0 folder. In my experience it is not necessary to specify -copyZero explicitly for that but it surely doesn't hurt either, except if your controlDict has a startTime other than 0. In that case the 0 folder is not copied so you might want to keep an eye on that.
Ship Designer is offline   Reply With Quote

Old   April 4, 2021, 15:03
Default Thanks Claudio
  #16
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 273
Rep Power: 6
boffin5 is on a distinguished road
Thanks Claudio, fantastic suggestion! I hope you realize that in all likelihood, I will come back and bug you with more questions
boffin5 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
[Transient rotating domain initialization from steady state run asanchez84 CFX 0 June 13, 2019 17:28
How to run OpenFOAM using Shared Memory method on local machine with multiple cores? ronithstanly OpenFOAM Running, Solving & CFD 1 August 4, 2017 00:31
Some ANSYS Benchmarks: 3 node i7 vs Dual and Quad Xeon evcelica Hardware 14 December 15, 2016 06:57
Shall I leave one core free when I run CFD simulation? Pierre1 Main CFD Forum 1 March 12, 2015 04:46
motorBike tutorial won't run correctly with 2.2.x Dan_Sobien OpenFOAM Running, Solving & CFD 4 September 6, 2013 04:33


All times are GMT -4. The time now is 01:31.