Natural convection in square cavity : trouble with the discretization
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Natural convection in square cavity : trouble with the discretization
- This topic has 3 replies, 2 voices, and was last updated 2 months, 1 week ago by shota.
-
AuthorPosts
-
June 4, 2024 at 2:56 pm #8763MutelleHMParticipant
Hello,
I’m currently a beginner in OPENLB and I started recently natural convection simulations using the “squareCavity2d” example provided with the last release of the code (/example/thermal/squareCavity2d directory). I set the value of the Rayleigh number to 10e3 and I tried to test the influence of the spatial discretization by changing the number N in the .cpp file. I varied the number N between N= 128 and N = 140 and I encountered some trouble with the allocation of the material number to the right vertical wall of the 2D square. The allocation is well done except for the values N = 131 – 132 – 135 and 139. In that cases, there is only one count associated with the right wall (material number = 3) whereas the count number is correct (= N) for the left wall (material number = 2). I don’t understand why the allocation is ok for certain values and not for others (I also tested N values between N = 5 and 10 and I have alse a trouble for the values N = 5 – 8 – 9 and 10). I precise that I run the calculations in parallel mode (mpi option) on 8 cores.
Could anyone provide guidance or resources that could help me to address this issue?
Thank you in advance for your help!Best regards
June 13, 2024 at 9:43 pm #8815shotaParticipantDear Mutelle,
sorry for the late response.
I looked into the implementation of the case and it seems that that example uses a deprecated way of assigning material numbers. I would refer to the laminar/cavity2d example regarding this issue. We will work on updating the deprecated case in the next release.
If you need more specific assist, please let us know.Best wishes,
Shota ItoJune 19, 2024 at 4:05 pm #8837MutelleHMParticipantDear Shota,
Thank you for your answer and for your help proposal. I take advantage of your offer of assistance to introduce you my problem. In the “squareCavity2d” example, I would like to impose a temperature profile (as a polynomial function T = f(x) where x is the horizontal position from the origin) on the two horizontal walls. The aim is to compare the OPEN LB results with the experimental data obtained by Ampofo & Karayiannis (2003). Could you please give me an example of code lines to insert into the data set or refer me to an example of the OPEN LB databank with this kind of boundary condition ?
Best regards
Hervé MutelleJune 27, 2024 at 11:03 am #8863shotaParticipantDear Hervé Mutelle,
in the squareCavity2d example the wall is a simple straight wall. In this case, you can define your own AnalyticalFunctor to prescribe a function for the temperature depending on the position.
Please refer to the example/advectionDiffusionReaction/convectedPlate3d. There a custom AnalyticalFunctor with the name ConvPlate3D which computes the analytical solution as a function of the spatial coordinates. This is done by the operator() function taking the spatial coordinates via input[] and passes the results via output[].
Using the same technique you can define a function for the wall and pass that functor to initEquilibrium and defineRho for the material numbers of the wall.Hope this helps.
Best wishes,
Shota -
AuthorPosts
- You must be logged in to reply to this topic.