Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh misalignment #11374

Closed
rakyuv opened this issue Jan 24, 2023 · 15 comments
Closed

Mesh misalignment #11374

rakyuv opened this issue Jan 24, 2023 · 15 comments
Assignees

Comments

@rakyuv
Copy link

rakyuv commented Jan 24, 2023

I understand the importance of aligning the mesh when it comes to between different resolutions, as mentioned in the FDS User guide 6.3.4.

I have the following mesh

&MESH ID='mesh1', IJK=125,125,40, XB=5250,5375,5250,5375,0,100,     TRNZ_ID='my trnz 1', MPI_PROCESS=0 /
&MESH ID='mesh2', IJK=125,125,40, XB=5375,5500,5250,5375,0,100,    TRNZ_ID='my trnz 1', MPI_PROCESS=1 /
&MESH ID='mesh3', IJK=125,125,40, XB=5250,5375,5375,5500,0,100,    TRNZ_ID='my trnz 1', MPI_PROCESS=2 /
&MESH ID='mesh4', IJK=125,125,40, XB=5375,5500,5375,5500,0,100,    TRNZ_ID='my trnz 1', MPI_PROCESS=3 /

&MESH ID='mesh5', IJK=125,125,40, XB=5250,5500,5250,5500,100,2180, TRNZ_ID='my trnz 2', MPI_PROCESS=4 /

&TRNZ ID='my trnz 1', CC=50,  PC=20 /
&TRNZ ID='my trnz 2', CC=620, PC=260 /

Mesh 5 has a two times coarser grid compared to Meshes 1, 2, 3 and 4, and the former (Mesh5) is on top of the latter (Meshes 1, 2, 3 and 4). I believe I am satisfying 'integral number of fine cells abutting a coarse cell' rule here. However I get the error stating the misalignment between 'Mesh 5' and 'Mesh 2'.

When I tried removing 'Mesh 2' and ran the code, I got the error that 'Mesh 5' is misaligned with 'Mesh 4'. So I am assuming that the 'Mesh 5' isn't aligned with any of the Meshes 1, 2, 3, 4.

Also I went through similar problem from someone else discussing how to solve the problem by visualising the grid in smoke view. In my situation, I can only see one of the grids on smoke view for xz plane. It would be helpful if you could explain how to check for my errors visually.

I have attached my input FDS file.
test_fds.txt

Any help or inputs are kindly appreciated

@drjfloyd
Copy link
Contributor

The case you attached only has four meshes and not five.

In smokeview, when you are displaying the grid typing x,y,or z will goggle the corresponding planes. See Appendix C of the Smokeview User's Guide.

Your TRNZ lines generate extremely large aspect ratios. This is not recommended (see FDS User's Guide 6.3.5).

@rakyuv
Copy link
Author

rakyuv commented Jan 24, 2023

Thank you @drjfloyd for your answer. My apologies for the wrong input FDS file. I attach the correct file here
test_fds.txt

Thank you for the keyboard shortcut for looking at multiple meshes. I found that the keys 'M/m' helps to toggle between multiple meshes if present. However I tried typing m or M, and seem to have no change in the display of the meshes

I understand the problem with my mesh stretching. I will try to maintain my aspect ratio less than 3.

Could you please help me with the Mesh misalignment ?

@rmcdermo
Copy link
Contributor

It is helpful to get handy with Smokeview to fix these issues. In this case, the first step is to add CHECK_MESH_ALIGNMENT=T on your MESH lines and then set T_END=0. Run the case. Then you can zoom in on your mesh boundaries in Smokeview. See below.

&HEAD CHID='step_methane_emission_multi_mesh',  TITLE='Test multi-mesh in methane emissions' /

&MESH ID='mesh1', IJK=125,125,40, XB=5250,5375,5250,5375,0,100,    TRNZ_ID='my trnz 1', MPI_PROCESS=0, CHECK_MESH_ALIGNMENT=T /
&MESH ID='mesh2', IJK=125,125,40, XB=5375,5500,5250,5375,0,100,    TRNZ_ID='my trnz 1', MPI_PROCESS=1, CHECK_MESH_ALIGNMENT=T /
&MESH ID='mesh3', IJK=125,125,40, XB=5250,5375,5375,5500,0,100,    TRNZ_ID='my trnz 1', MPI_PROCESS=2, CHECK_MESH_ALIGNMENT=T /
&MESH ID='mesh4', IJK=125,125,40, XB=5375,5500,5375,5500,0,100,    TRNZ_ID='my trnz 1', MPI_PROCESS=3, CHECK_MESH_ALIGNMENT=T /

&MESH ID='mesh5', IJK=125,125,40, XB=5250,5500,5250,5500,100,2180, TRNZ_ID='my trnz 2', MPI_PROCESS=4, CHECK_MESH_ALIGNMENT=T /

&TRNZ ID='my trnz 1', CC=50,  PC=20 /
&TRNZ ID='my trnz 2', CC=620, PC=260 /

&TIME T_END=0.0 /
...

Screen Shot 2023-01-24 at 9 25 20 AM

@drjfloyd
Copy link
Contributor

@gforney run the case thrid post and load the smv file into smokeview. If turn on mesh outlines and type m, I cycle through the meshes. If I turn on the grids by typing g, then m no longer works. Is this intentional?

@drjfloyd
Copy link
Contributor

Your coarse mesh is half the resolution of your fine meshes; however, you have an odd number of cells for the x and y direction of your fine meshes. This means that the midpoint cell of your coarse mesh sees cells from two meshes and this is not allowed.

@drjfloyd
Copy link
Contributor

Looking at the user's guide, this requirement isn't very clear in Figure 6.2.

drjfloyd added a commit to drjfloyd/fds that referenced this issue Jan 24, 2023
drjfloyd added a commit that referenced this issue Jan 24, 2023
FDS User Guide: Issue #11374 Clarify coarse-fine with multiple mesh.
@rakyuv
Copy link
Author

rakyuv commented Jan 24, 2023

Thank you @drjfloyd and @rmcdermo for your inputs and clarifications regarding the mesh alignment and aspect ratios. I have incorporated everything and the code seems to run well.

Somehow, the option 'm/M' never worked for me in Smokeview. I could circle through 'g' option.

@rakyuv rakyuv closed this as completed Jan 24, 2023
@gforney
Copy link
Contributor

gforney commented Jan 24, 2023

should be fixed in smokeview's posted below (using 'm' hilight meshes while in 'grid view' mode )

https://drive.google.com/drive/folders/0B_wB1pJL2bFQc1F4cjJWY2duWTA?resourcekey=0-J_yHat7iJoBp1fk6QS8gMA&usp=sharing

@rakyuv rakyuv reopened this Jan 25, 2023
@rakyuv
Copy link
Author

rakyuv commented Jan 25, 2023

Hello everyone,

I am reopening this issue. I followed the recommendations, and I constructed the grid. I still get the mesh misalignment. However, with Smokeview, I don't see any sort of misalignment. I have attached the image here

1

This is my fds file
test_fds.txt

Any help or input would be kindly appreciated

@drjfloyd
Copy link
Contributor

In the image the meshes have different Z ranges. When I look at the file you attached, all the Z ranges are the same. Did you attach the correct file?

@rakyuv rakyuv closed this as completed Jan 25, 2023
@rakyuv rakyuv reopened this Jan 25, 2023
@rakyuv
Copy link
Author

rakyuv commented Jan 25, 2023

I think the way I had taken the screenshot (in the previous comment) might give the impression that it is the Z grid. However, the image shows the XY- grid. And the image only shows one half of the grid, because I wanted to show the two refinements in a single image. Full XY- grid is

214602872-3cf7e3cb-8485-4424-87f1-268464358fb7

The central grid is

214602948-0d62d4ba-242c-4e89-a020-62204b257f22

The Z ranges are the same for the entire domain. I have attached the correct FDS file corresponding to the image

@drjfloyd
Copy link
Contributor

You have the same problem. Coarse cells can only see fine cells in one mesh. It says mesh 4 + 8 and 5 +9 are not aligned.

The boundary of mesh 4 is from x=5400 to x=5580 with a 9 m resolution.
The boundary of mesh 8 is from x=5220 to x=5760 with a 27 m resolution.

What are the cell edges of mesh 8 at lower x for mesh 4? The cell edges of mesh 8 are at 5382 and 5409. So the mesh 8 cell is seeing cells from two meshes.

@rakyuv
Copy link
Author

rakyuv commented Jan 25, 2023

Thank you @drjfloyd for your answer. Could you please explain what you mean by cell edges of a mesh ? How did you get the numbers 5382 and 5409 ? I am not able to understand how mesh 8 cell is seeing cell from two meshes.

If by seeing cell from two meshes, you mean that size of mesh 8 is long enough that it meets different meshes, then the y value of mesh 6 goes from y=4680 to y=6300, and therefore it meets mesh 2, mesh 8 and mesh 9. I don't see any error from this direction.

Could you please tell me where I am going wrong ?

@drjfloyd
Copy link
Contributor

In the input file you attached an hour ago your mesh lines for meshes 2, 4 ,and 8 are:

&MESH ID='mesh2', IJK=20,60,40, XB=5220,5400,5220,5760,100,1100, TRNZ_ID='my trnz 2', MPI_PROCESS=1, CHECK_MESH_ALIGNMENT=T /
&MESH ID='mesh4', IJK=20,20,40, XB=5400,5580,5580,5760,100,1100, TRNZ_ID='my trnz 2', MPI_PROCESS=1, CHECK_MESH_ALIGNMENT=T /
&MESH ID='mesh8', IJK=20,20,40, XB=5220,5760,5760,6300,100,1100, TRNZ_ID='my trnz 2', MPI_PROCESS=2, CHECK_MESH_ALIGNMENT=T /

This means the grid cell edges for mesh 8 are 5220, 5247, ... 5382, 5409, ... 5760.
Mesh 4 starts at 5400 and the next cell edge is 5409.
Mesh 2 starts at 5220 and ends at 5400 making the last two cells 5382 to 5391 and 5391 to 5400.

So the mesh 8 cell that goes from 5382 to 5409 sees two cells from mesh 2 (5382 to 5391 and 5391 to 5400) one cell from mesh 4 (5400 to 5409). This is not allowed. The mesh 8 cell from 5382 to 5409 can only be adjacent to cells from a single mesh.

@rakyuv
Copy link
Author

rakyuv commented Jan 25, 2023

Thank you @drjfloyd for your patience and for making it completely clear. I certainly understand where I went wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants