CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Properties as a function of space/cellzone – porous region

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

LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2021, 15:59
Default Properties as a function of space/cellzone – porous region
New Member
Join Date: Dec 2015
Posts: 1
Rep Power: 0
absorbedsponge is on a distinguished road
I have a natural convection problem inside an enclosure with solid, fluid, and a porous region. I am using the chtMultiRegionFoam solver (OpenFOAM 1906). I have determined two ways of setting up this simulation (one way is non-functional). However, both ways could work. I will describe the two ways I implemented this simulation as well as possible ideas on how to fix the issues/limitations associated with each implementation. It should be noted here that I have little C++ coding experience (more familiar with fortran, object oriented C++ knowledge is really weak)

A. The way I initially attempted to setup this simulation was to create 3 separate regions: SOLID, FLUID, POROUS. In this way I can specify the properties of each region independently. This allows me to specify the effective POROUS properties, such as effective thermal conductivity in the porous media (which is different from the thermal conductivity in the FLUID). Setting up the problem this way I end up with a boundary between POROUS and FLUID, which is technically a fluid fluid boundary. To my understanding there are no default/built in boundary conditions for this boundary (there are boundary conditions for fluid solid regions, which I have already implemented). I was able to get this simulation to “run” using a mapped and compressible::turbulentTemperatureCoupledBaffleMix ed boundary conditions; however, I know that these boundary conditions will not conserve fluxes across the boundary. This leads to a spike in velocity at the boundary, and is unacceptable set up this way.

B. I believe the correct way to set up this simulation is to create 2 regions: SOLID and FLUID with a cellzone that represents the porous media. This cellzone works as the porous region, it is a subset of the FLUID region (created via topoSet and fvOptions). This setup works as intended; however, I cannot find a way to set different fluid properties (set effective properties which represent the porous media) for the cellzone that represents the porous media.

If anyone knows of a simple workaround/feature/option for A or B that I am missing that would be greatly appreciated! Otherwise, I have a few ideas how to fix/work around these shortcomings.

1. Create custom boundary conditions for the fluid fluid boundary. I think that this will be rather complicated, ensuring conservation of fluxes across this boundary is currently well above my C++ knowledge. I am looking into codeStream, but I don’t think (maybe I’m wrong) this simpler method is sufficient. However, if someone has already created this boundary condition then that may prove to be a solution.

2. Set the properties as a function of space. If I can set the properties (e.g. thermal conductivity = f(x,y,z)) as a function of space, I can set the values of the properties differently in the porous region. I imagine this as a non-uniform list, where the index in the array of values corresponds to some cell in the mesh. The position of this cell can be determined by “postProcess -func writeCellCentres” which will create tables of cell centers (C,Cy,Cx,Cz). This info can then be used to write a script which generates the corresponding lists of properties, so that the properties in the porous region are different. The real issue I have with this fix is how to make thermophysicalProperties read this list/table of property values (for k, Cp, mu, etc.). My assumption is that I would need to take a “type” from “thermoType” and create some custom type which acts as a lookup table. Again, this is currently above my C++ OpenFOAM coding knowledge.

If anyone has an ideas/strategies for solving this issue that would be great! I currently do not have much time to solve this issue. If I cannot find a solution/workaround I will have to live without effective properties in the porous media.

Even if I cannot find a solution, I think the enhanced functionality of spatially varying properties may be useful for others as well. Any help/ideas/suggestions are greatly appreciated!!!


Notes: I wasn’t sure exactly where to post this, as maybe this is more of a programming topic. If this needs moved please move.
absorbedsponge is offline   Reply With Quote


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 08:15
Problem with chtMultiregionFoam radiation boundary condition baran_foam OpenFOAM Running, Solving & CFD 10 December 17, 2019 18:36
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42

All times are GMT -4. The time now is 07:06.