CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[PyFoam] Using snappyHexMesh -overwrite with BasicRunner

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2021, 18:52
Default Using snappyHexMesh -overwrite with BasicRunner
New Member
Join Date: Dec 2020
Posts: 2
Rep Power: 0
DaveyGravy is on a distinguished road

I am trying to automate a mesh convergence study using PyFoam to vary the refinement levels of my mesh.

I haven't found a way to use the -overwrite option for snappyHexMesh with BasicRunner, leaving me unable to run a solver.

Here is my BasicRunner code:
# decompose case for parallel run
Decomposer(args=["--progress", "--method=simple",
            "--n=3,2,1", "--delta=1e-4", "--decomposer=decomposePar -copyZero",, 6]
machine = LAMMachine(nr=6)
# run snappy
runSnappy = BasicRunner(
    argv=["snappyHexMesh", "-case",], silent=True, parameters="overwrite", logname="snappyHexMesh", lam=machine
And here is the fatal error that is returned:
Create time

Create mesh for time = 3

 Reading field p

[3] cannot find file "/home/daveygravy/scripting/OpenFOAM/dragOverSphereSnappy/flowAroundSphereSnappy-nu100/processor3/3/p"
[3]     From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::readStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const
[3]     in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 539.
FOAM parallel run exiting
If I can use snappyHexMesh -overwrite, then Create mesh for time = 3 will change to Create mesh for time = 0, and my run can progress.

I've taken a look at the source code, though I don't see a straightforward way to implement -overwrite.

Any help is appreciated, thanks!
DaveyGravy is offline   Reply With Quote

Old   August 11, 2022, 20:44
New Member
Join Date: Dec 2020
Posts: 2
Rep Power: 0
DaveyGravy is on a distinguished road
Hoping someone has attempted this in the meantime...
DaveyGravy is offline   Reply With Quote


automate, mesh convergence, pyfoam, snappy hex mesh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[snappyHexMesh] Problem with snappyHexMesh overwrite Manideep Reddy OpenFOAM Meshing & Mesh Conversion 6 July 29, 2023 01:05
[snappyHexMesh] mpirun -np 6 snappyHexMesh -overwrite -parallel FOAM FATAL ERROR tacia OpenFOAM Meshing & Mesh Conversion 2 September 25, 2020 07:57
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 02:54
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. jasv OpenFOAM Meshing & Mesh Conversion 4 May 10, 2016 02:55
[snappyHexMesh] snappyHexMesh -overwrite flag in 1.5-dev norman1981 OpenFOAM Meshing & Mesh Conversion 3 January 31, 2010 13:31

All times are GMT -4. The time now is 23:18.