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

[openFuelCell] DecomposePar generates internal holes

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

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By Swagga5aur

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 22, 2018, 17:16
Post DecomposePar generates internal holes
  #1
Senior Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 111
Rep Power: 10
Swagga5aur is on a distinguished road
Hello dear openFOAM'ers,

I'm working with some HTPEM modelling based upon the source code found at: http://openfuelcell.sourceforge.net/.

Currently having a working case running with a single processor, however, when I decompose the case it generates internal empty regions as shown in the attachments, one pre decomposition and the other decomposed. The regions is only generated in the processor to processor plane (where they meet).

I have tried with simple decomposition method, manual (based upon a cellID generation from the previously mentioned code) and scotch.

Scotch resulted in no visible regions, however, the simulation could not run due to naming issues caused by the decomposition.

The base mesh is generated in snappyHexMesh and I noticed this issue when trying to reconstruct the regions of a parallel simulation I got the following error when reconstructing the point fields: Incomplete patch point addressing


Thanks for any support in advance and please let me know if any additional information is required for support on this issue.

Best regards Lasse
Attached Images
File Type: png notDecomposed.png (15.1 KB, 10 views)
File Type: png Decomposed.png (19.9 KB, 14 views)
Swagga5aur is offline   Reply With Quote

Old   December 22, 2018, 18:26
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: This looks like a rendering bug, not an OpenFOAM bug... see this entry on the FAQ to see what I mean: https://openfoamwiki.net/index.php/F...is_in_ParaView

As for the "Incomplete patch point addressing", I suspect that is due to something else entirely... but without more specific steps and the file names themselves, along with complete error outputs, it's hard to diagnose the issue here.
__________________
wyldckat is offline   Reply With Quote

Old   December 23, 2018, 06:47
Post
  #3
Senior Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 111
Rep Power: 10
Swagga5aur is on a distinguished road
Hello Bruno,

thanks for the quick response.
I just suspected the gaps as the same tendencies aren't observed in a similar case from the source code.

The mesh is generated through the following.

Code:
blockMesh
surfaceFeatureExtract
rm -rf system/decomposeParDict
mv system/decomposeParDictMesh system/decomposeParDict
decomposePar
mpirun -np $NPROCS snappyHexMesh -overwrite -parallel
reconstructParMesh -constant

rm -rf processor*
mv system/decomposeParDict system/decomposeParDictMesh

##-------------------------------------------------------------------------------
echo -e "   - Split mesh into the single regions"

splitMeshRegions -cellZones -overwrite

#-------------------------------------------------------------------------------
echo -e "   - Create file for paraview"
touch paraview.foam

#-------------------------------------------------------------------------------
echo -e "   - Rename air and fuel patches"
createPatch -region fuel -overwrite
createPatch -region air -overwrite


rm -rf 0

cp -a 0.org 0

topoSet -region air
topoSet -region fuel
topoSet -region electrolyte
After this the case is run able in serial directly. To run it in parallel I run the following code to pre process the case.
Code:
cp system/decomposeParDictSim system/decomposeParDict
cp -rf system/decomposeParDict system/air/.
cp -rf system/decomposeParDict system/fuel/.
cp -rf system/decomposeParDict system/abp/.
cp -rf system/decomposeParDict system/cbp/.
cp -rf system/decomposeParDict system/electrolyte/.

decomposePar -force
decomposePar -region air
decomposePar -region fuel
decomposePar -region electrolyte
decomposePar -region abp
decomposePar -region cbp

mpirun -np $NPROCS foamExec splitMeshRegions -cellZones -parallel

@ I = 0
while ( $I < $NPROCS )

cp -rf processor$I/1/. processor$I/constant/.

rm -rf processor$I/1

@ I++

end

rm -rf processor*/constant/polyMesh/sets processor*/constant/polyMesh/*Zones

# air zones
#
mpirun -np $NPROCS foamExec setSet -batch ./config/make.setAir -region air -constant -noVTK -parallel
mpirun -np $NPROCS foamExec setsToZones -noFlipMap -region air -constant -parallel

# fuel zones
#
mpirun -np $NPROCS foamExec setSet -batch ./config/make.setFuel -region fuel -constant -noVTK -parallel
mpirun -np $NPROCS foamExec setsToZones -noFlipMap -region fuel -constant -parallel

# electrolyte zones
#
mpirun -np $NPROCS foamExec setSet -batch ./config/make.setElectrolyte -region electrolyte -constant -noVTK -parallel
mpirun -np $NPROCS foamExec setsToZones -noFlipMap -region electrolyte -constant -parallel
I have attached a log with the entire error code when running reconstructPar for either of the respective fluid regions.

I am able to reconstruct the thin blue center region in the middle and the outer grey and red regions. Those three regions are all solids.

Let me know if there is any other information you require.
Attached Files
File Type: txt log.txt (2.2 KB, 3 views)

Last edited by Swagga5aur; December 23, 2018 at 09:07.
Swagga5aur is offline   Reply With Quote

Old   December 23, 2018, 16:34
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answers:
  1. I don't know which version of OpenFOAM you are using... wait, from the log file you are using OpenFOAM 6, therefore it should be possible to use the option "-dict" with decomposePar, e.g.:
    Code:
    decomposePar -dict system/decomposeParDictMesh
  2. The two createPatch commands, I guess that you have one "createPatchDict" within the respective region folder at "system"? E.g.: "system/air/createPatchDict"
    My concern here is for whatever reason, it used the same "system/createPatchDict" file, that could be one possible original of problems...
  3. Strange... why didn't you use "-overwrite" with splitMeshRegions when running in parallel?
  4. Why are you using setSet and setsToZones, if topoSet can be run in parallel!?
  5. I've run just now the tutorial case "mesh/moveDynamicMesh/SnakeRiverCanyon" with the following commands:
    Code:
    blockMesh
    decomposePar
    foamJob -p -s moveDynamicMesh
    reconstructPar
    And it worked well for me... it was able to reconstruct the point field "pointDisplacement".
    • That said, it is possible that this feature is not properly supported for regions...
Quick question: Is there any tutorial case on the openfuelcell project that I can use to test this myself? Because this is really strange... perhaps the point field is created incorrectly on each processor?
wyldckat is offline   Reply With Quote

Old   December 23, 2018, 17:51
Post
  #5
Senior Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 111
Rep Power: 10
Swagga5aur is on a distinguished road
1. I'll use that from now on didn't realize that was a possibility. You are correct I am using OpenFOAM 6.

2. Yes that is correct, I rename two patches to from min, max to inlet and outlet of the respective regions (both fuel and air). I could try renaming some of the patches of the regions that I can reconstruct, to see if it provokes the issue.

3. Just used the same approach as in the source code example cases, it would make more sense to just overwrite and remove the step with copying and remove the 1 folder.

4. Same as no.3 same approach as the examples, just wanted to make something that works. I will use topoSet in my future cases as its more straight forward.

5. Hmm, well the current case I'm working on is based upon some confidential geometries, just reduced the domain with the size of blockMesh but having the original stl files in the directory.

I will try to make a dummy case before new year which is share able for further debugging.

Let me know if you want me to test something in the mean time.

I'm going to make the same case where no renaming/createPatch is required to see if this solves the issue.

I forgot to mention that I also run a renaming script for the decomposed case as the createPatch renaming is lost during decomposition and I believe that might be the main issue.

Code:
@ I = 0
while ( $I < $NPROCS )

	set DESTA = processor$I/constant/air/polyMesh
	set DESTF = processor$I/constant/fuel/polyMesh

	sed -i 's/minZ/airInlet/' $DESTA/*
	sed -i 's/maxZ/airOutlet/' $DESTA/*

	sed -i 's/minZ/fuelInlet/' $DESTF/*
	sed -i 's/maxZ/fuelOutlet/' $DESTF/*

    echo "processor"$I "done"
    @ I++
end

Last edited by Swagga5aur; December 23, 2018 at 18:31. Reason: Forgot to mention some renaming
Swagga5aur is offline   Reply With Quote

Old   December 23, 2018, 19:15
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by Swagga5aur View Post
I'm going to make the same case where no renaming/createPatch is required to see if this solves the issue.

I forgot to mention that I also run a renaming script for the decomposed case as the createPatch renaming is lost during decomposition and I believe that might be the main issue.
Quick answer: createPatch should work just fine, it's shouldn't be necessary for you to change that.

Furthermore, createPatch can also be executed in parallel as you do with the other applications. Therefore, you should not use the hack relying on "sed -i" to hack inside all files within "polyMesh".

So there are now two possible reasons for the problem in reconstruction:
  1. A critical file in "polyMesh" might have gotten damaged.
  2. The solver might not be dealing properly with the point fields.
Swagga5aur likes this.
wyldckat is offline   Reply With Quote

Old   December 25, 2018, 11:12
Post
  #7
Senior Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 111
Rep Power: 10
Swagga5aur is on a distinguished road
That solved it, thanks Bruno and merry christmas!

What I did for now was just overwriting the splitMesh created decomposed directories with the individual decomposition of the respective regions such that they maintained there createPatch and topoSet modifications.

I could also just apply the createPatch and topoSet in parallel instead.
wyldckat likes this.
Swagga5aur is offline   Reply With Quote

Reply

Tags
decomposepar, parallel, snappyhexmesh

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
Structured domain with internal holes Alexl93 Pointwise & Gridgen 3 March 22, 2019 17:44
[snappyHexMesh] snap stage generates internal triangles Svensen OpenFOAM Meshing & Mesh Conversion 0 May 20, 2016 16:03
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 23:38
[snappyHexMesh] Snap generates holes in the mesh Svensen OpenFOAM Meshing & Mesh Conversion 0 March 25, 2015 04:20
decomposePar gives errors of_user_ OpenFOAM 1 July 4, 2011 06:27


All times are GMT -4. The time now is 05:11.