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

[PyFoam] Using snappyHexMesh -overwrite with BasicRunner

Register Blogs Community New Posts Updated Threads Search

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

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:
Code:
# decompose case for parallel run
Decomposer(args=["--progress", "--method=simple",
            "--n=3,2,1", "--delta=1e-4", "--decomposer=decomposePar -copyZero", case.name, 6]
)
machine = LAMMachine(nr=6)
# run snappy
runSnappy = BasicRunner(
    argv=["snappyHexMesh", "-case", case.name], silent=True, parameters="overwrite", logname="snappyHexMesh", lam=machine
)
runSnappy.start()
And here is the fatal error that is returned:
Code:
Create time

Create mesh for time = 3

 Reading field p

[3] --> FOAM FATAL ERROR:
[3] cannot find file "/home/daveygravy/scripting/OpenFOAM/dragOverSphereSnappy/flowAroundSphereSnappy-nu100/processor3/3/p"
[3]
[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.
[3]
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, 21:44
Default
  #2
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

Reply

Tags
automate, mesh convergence, pyfoam, snappy hex mesh


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


All times are GMT -4. The time now is 08:02.