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

simulating 2D porous media but the results is dependent on z-dimension

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2023, 11:39
Default simulating 2D porous media but the results is dependent on z-dimension
  #1
New Member
 
Join Date: Aug 2022
Posts: 19
Rep Power: 4
shizuka is on a distinguished road
Hi everyone,


I have two questions:
1. What exactly does OpenFOAM do with the third dimension (diffusion + convection if needs to be specific) when simulating in 2D?


2. Why in my 2D simulation of a porous media (using Darcy-Forchheimer), the results are highly dependent on the third dimension, the z-axis? I would expect that no matter what value I put on z, it shouldn't have any impact on my 2D simulation. I tried

  • set the thickness of the cellzones to be either bigger or equal to the thickness of the "3D" model (whose back and front faces are set "empty", only one cell in z-direction of thickness 0.1)

  • enable/disable the third ax rotation:
Code:
axesRotation;
... 


e3 (0    0    1);
  • add units when defining d and f
Code:
d [0  -2  0  0  0  0  0] (2500   5500   5500);
f [0  -1  0  0  0  0  0] (0   0   0);
Note that I also tested on a tutorial model "porousBlockage". In this model, no matter the third component of d set to zero or 1000, the result is independent.



When I applied to my target model, however, the results are significantly impact by the third component of d. In fact, Dx, Dy (the first two Darcy components) have little impact, which doesn't make any sense.





The region of the cellZones are visible in the lower of the figure, they are three rectangles. Without change Dx and Dy, by different Dz, the result is different. In fact, if Dz remains unchanged, there are only little to no difference with different combinations of Dx, Dy...


- The inlet of the airflow is from the lower left corner
- The outlet is on the upper left corner


Could anyone know what could be wrong in my settings? Thank you very much!
Attached Images
File Type: png depend on Dz.png (102.9 KB, 37 views)
shizuka is offline   Reply With Quote

Old   March 6, 2023, 09:14
Default
  #2
New Member
 
Join Date: Aug 2022
Posts: 19
Rep Power: 4
shizuka is on a distinguished road
Today I also tried
- set origin to be (0 0) instead of (0 0 0), it will throw out fetal error, has to be (0 0 0)


- set e3 (0 0 0) instead of (0 0 1), no difference. In fact, as I mentioned above, turning e3 on or off makes no difference at all...
shizuka is offline   Reply With Quote

Old   March 6, 2023, 14:37
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hey,

  • The rotation you specify with e3 are not considered. We only span two vectors to ensure the correct rotation. However, i you case its simply (1 0 0) and (0 1 0) for e1 and e2 as you dont have any rotation
  • Commonly the second/third dimensions are not taken into consideration if you are using the empty patches
  • As you already showed with the tutorial case that in a 2D case, the third dimension is not really of importance, are you sure that you are doing things correctly?
  • Is you mesh aligned with x-y and not x-z?
  • Do you set the patch-type to be empty in the boundary file as well as in the field files?
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 8, 2023, 08:54
Default
  #4
New Member
 
Join Date: Aug 2022
Posts: 19
Rep Power: 4
shizuka is on a distinguished road
Hi Tobias,

Thank you very much for your suggestions. I checked mainly two things based on the hints.

=====

Quote:
Originally Posted by Tobi View Post
  • Is you mesh aligned with x-y and not x-z?

I prepared the blockmeshDict myself. I realized that the face(s) of my mesh maybe not consistent:



For example, in defining the boundary conditions, I typed the faces like

Code:
(0   1   5   4)
(3   2   6   7)
I wonder
1. The orientation of each face of a block should strictly point outwards, doesn't it?


2. In defining the blocks, am I correct to provide the nodes in this order?
Code:
hex (0   1   2   3   4   5   6   7)(refinement)(grading)
3. How could I check if the mesh is aligned with x-y or x-z? What does it mean?


=====

Quote:
Originally Posted by Tobi View Post
  • As you already showed with the tutorial case that in a 2D case, the third dimension is not really of importance, are you sure that you are doing things correctly?

I get one step back and re-examine the tutorial case, which uses pisofoam and doesn't have heat transfer. I tested step by step, from pisofoam to simplefoam to the final buoyantsimplefoam.

It is strange that the tutorial case "works" (third dimension Dz doesn't impact the simulation result), even for the adapted buoyantsimplefoam case. But later I found out that I was wrong! Because in the tutorial case the author has such comment:
Code:
// D 100;  // Very little blockage
// D 200;  // Some blockage but steady flow
// D 500;  // Slight waviness in the far wake
// D 1000; // Fully shedding behavior
So I trusted that 1000 is a "large enough" number that fully block that dimension, and all my test were comparing difference between Dz = 0 and Dz = 1000. >> came to the conclusion that "the dummy model works."

Later I found that if Dz is really huge, say 1e8, there is visible difference. The figure underneath is a comparison between three pisofoam case (so just changed the inlet/outlet, BC, and geometry of the cellzone inside from the original tutorial):



The difference between up and middle figure is very small, U_magnitude differs 0.001. However, it is visible that if Dz = 1e8, the outline of the cellzone is much harder than the other settings.


Hence my question is
4. Is cellZone in fact always 3D by default?? I know OpenFOAM itself is always 3D, but can we tell cellZone that we are running a "2D" case?


=====

Quote:
Originally Posted by Tobi View Post
  • Commonly the second/third dimensions are not taken into consideration if you are using the empty patches
  • Do you set the patch-type to be empty in the boundary file as well as in the field files?



Above are the setting of the boundaries. Front and back are defaultFaces and are set to empty.



5. Could you please elaborate more on this comment: Do you set the patch-type to be empty in the boundary file as well as in the field files?

What/where are the field files? I have d/f coeffs in the fvOptions (the property), and cellzone is defined in the topoSetDict (the geometry). The topoSetDict is as following:


Code:
actions
(
    // porousBlockage
    {
        name    porousBlockageCellSet;
        type    cellSet;
        action  new;
        source  boxToCell;
        box     (-1.5 -1.5 -1) (-0.5 1.5 1);
    }
    {
        name    porousBlockage;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        set     porousBlockageCellSet;
    }
);
Maybe my problem is that I didn't include a field file?



Thank you very much for your time and help!
Attached Images
File Type: jpg darcy-model.jpg (45.3 KB, 26 views)
File Type: jpg boundary_s.jpg (18.5 KB, 25 views)
File Type: jpg block orientation_s.jpg (22.0 KB, 25 views)
shizuka is offline   Reply With Quote

Old   March 8, 2023, 09:39
Default
  #5
New Member
 
Join Date: Aug 2022
Posts: 19
Rep Power: 4
shizuka is on a distinguished road
For the last question 5 in the previous post, if the field file refers to the definition in the 0 folder:





Yes, then I have in all p, U, T, ..., etc. files that



Code:
    defaultFaces
    {
        type            empty;
    }
defaultFaces are the front and back faces that I didn't specified in blockmeshDict exclusively.
Attached Images
File Type: jpg field file.jpg (171.3 KB, 23 views)
shizuka is offline   Reply With Quote

Old   March 9, 2023, 08:45
Default
  #6
New Member
 
Join Date: Aug 2022
Posts: 19
Rep Power: 4
shizuka is on a distinguished road
My latest experiment result with the tutorial case:



Some observation for 2D porous media simulation:
  • Once Dz reaches 1e8, the simulation result is similar no matter what Dx/Dy is
  • The impact from Dz can be disregarded up to Dz = 1e5 (note: for case D = (50 50 1e5), when reload file in paraView, a slight change in pattern was observed)
  • From 1e6 onwards, the impact from Dz is visible



Please correct me if I was wrong and always welcome for comments!
Attached Images
File Type: jpg impact Dz experiment.jpg (103.6 KB, 20 views)
shizuka 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
Fluent - Flow/heat transfer over porous media - possibly interface issue ayihan FLUENT 0 March 3, 2018 19:55
2Phase flow simulation in Porous Media Ansys Fluent Yaqub FLUENT 0 June 22, 2017 04:46
about porous media major FLUENT 5 March 6, 2013 11:00
Porous media boundary conditions aggie FLUENT 3 June 17, 2012 10:51
porous media divergence Phil FLUENT 0 March 13, 2002 07:03


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