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

chtMultiRegionFoam different properties in (fluid) region(s)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 3, 2014, 06:40
Default chtMultiRegionFoam different properties in (fluid) region(s)
  #1
New Member
 
Volker
Join Date: Aug 2014
Location: Germany
Posts: 16
Rep Power: 11
volker1 is on a distinguished road
Hi everybody,

I am going to solve a transient fluid problem where a compressible flow will pass two porous regions in series, connected by a narrow channel. I already found out that multiple regions are no standard capability of OF solvers and adding this capability will probably be much work. On the other hand the fvOptions feature available for chtMultiRegionFoam allows to add porosity using explicitPorositySource to add Darcy-Forchheimer coefficients. I tried it out extracting an fvOptions file from a tutorial and I got a flow field as well as an impact of porosity that look already reasonable. Later also heat transfer to the wall is to be implemented. So I think chtMultiRegionFoam seems a good basis for my problem (am I right here?).

For some time now I am stuck with the problem how to specify two (slightly) different porosity regions. If I just divide my flow region into two neighbouring regions, the two flow regions will be solved separately and I get a completely different flow field (as neighbouring flow regions are obviously not connected automatically).

So my question is can I
(1) specify sub-regions for the fluid region or
(2) merge two fluid regions before the calculation without merging all properties data, too, or
(3) solve this by connecting the neighbouring fluid regions by something like “calculated boundary conditions” (I did not manage to realise the nearby idea successfully to set the fluid1_to_fluid2 boundary fields to “type calculated” so far) or
(4) ... other ideas ...?

A hint to a promising proceeding would be fine.

Regards, Volker
volker1 is offline   Reply With Quote

Old   February 4, 2015, 05:18
Default
  #2
New Member
 
Volker
Join Date: Aug 2014
Location: Germany
Posts: 16
Rep Power: 11
volker1 is on a distinguished road
Hi everybody,
in case someone should have the same problem or just is curious how this proceeded. This is what I found so far (for version 2.3.1).

0. Each region is always calculated as a unit, one after another, clear from a look at the solver loops. This is a formal reason (that certainly makes sense), but e.g. there is no need for a region to be a geometrical unit (cyclic boundary conditions seem a simple way to connect distant mesh parts to a single region but this does of course not necessarily make sense ...).
For my case this means I should use a single fluid region, so I try to introduce something like “sub-regions”. The below proceeding will merge several cellZones “subset1_of_region_name”, “subset2_of_region_name”, … into a single cellZone (and region in this case) named “region_name”.


1. with the command “topoSet” one has to specify a cellSet with “region_name”. The ~case/system/topoSetDict file could look like that:
Code:
actions
 (
   {   
         name    region_name;
         type    cellZoneSet;
         action  new;
         source  zoneToCell;
         sourceInfo
           {
             name  subset1_of_region_name;  // name of one cellSet (seems no matter which one) that is part of the generated region
           }
   }
 )
2. now the command “splitMeshRegions -cellZonesFileOnly cellZones_korr” provides the opportunity to generate a region containing different cellZones.
This file I named “cellZones_korr” bases on the original ~case/constant/polyMesh/cellZones file. This original file is e.g. available after running blockMesh if the cell zones are specified as block names in the ~case/constant/polyMesh/blockMeshDict file. The original file is still required and therefore must not just be simply overwritten. Instead, in the “cellZones_korr” file, one collects all the cell labels from the subset zones that should represent one region under the name of the region “region_name”. The original “subsetX_of_region_name” cellZone names have to be removed in this file, otherwise they will appear as regions again.


As a result, at the region level there seems no difference to the case where all subzones had been defined as a single region from the beginning on. The specification, calculation and output in the subzones are still done in the “region_name” subdirectories.
What is new, however, the subzones are now available and separately accessible in paraView if "include zones” is set. This also implies that the cell labes of the subzones are accessible in the original ~case/constant/polyMesh/cellZones file. This certainly is helpful with regard to modifications of properties on the subzones level, e.g. by introducing fields for lookup.

Regards, Volker
volker1 is offline   Reply With Quote

Old   February 4, 2015, 05:29
Default
  #3
Senior Member
 
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 12
derekm is on a distinguished road
Can you post a test case with all the scripts for building it? That way I can be clear what it is you have done

thanks

derek
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET
derekm is offline   Reply With Quote

Old   February 4, 2015, 07:46
Default
  #4
New Member
 
Volker
Join Date: Aug 2014
Location: Germany
Posts: 16
Rep Power: 11
volker1 is on a distinguished road
Hi derek,

I simplified and stripped my case to the mesh and region creation for clarity.

The Readme file proposes two sequences of commands so one can see what happens with and without the manipuilation.

This example even seems to work without the topoSet command, but chtMultiRegionFoam did not operate properly without it.



Edit:
As the final step to solve my problem of two subzones with slightly different porosity inside the same region I had to place an fvOptions file in the $case/system/region_name directory with the content:

Code:
porosity1
{
    type            explicitPorositySource;
    active          true;
    selectionMode   cellZone;
    cellZone        subset1_of_region_name;  

    explicitPorositySourceCoeffs
    {
        type            DarcyForchheimer;

        DarcyForchheimerCoeffs
        {
            d   d [0 -2 0 0 0 0 0] (7e2 7e2 7e2);
            f   f [0 -1 0 0 0 0 0] (0 0 0);

// this seems required for OF231:

            coordinateSystem
            {
                type    cartesian;
                origin  (0 0 0);
                coordinateRotation
                {
                    type    axesRotation;
                    e1      (0 1 0);
                    e2      (0 0 1);
                }
            }
         }
    }
} 

porosity2
{
    type            explicitPorositySource;
    active          true;
    selectionMode   cellZone;
    cellZone        subset2_of_region_name;  

    explicitPorositySourceCoeffs
    {
        type            DarcyForchheimer;

        DarcyForchheimerCoeffs
        {
            d   d [0 -2 0 0 0 0 0] (5e2 5e2 5e2);
            f   f [0 -1 0 0 0 0 0] (0 0 0);

// this seems required for OF231:

            coordinateSystem
            {
                type    cartesian;
                origin  (0 0 0);
                coordinateRotation
                {
                    type    axesRotation;
                    e1      (0 1 0);
                    e2      (0 0 1);
                }
            }
         }
    }
}
That's it!

Hope it is useful.

Regards, Volker
Attached Files
File Type: zip testcase1.zip (6.7 KB, 85 views)

Last edited by volker1; March 6, 2015 at 07:15. Reason: complete answer to original question
volker1 is offline   Reply With Quote

Reply

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
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
Variation of properties of the fluid Thermal_engg FLUENT 2 June 5, 2013 06:44
How to choose the mean diameter value for dispersed fluid? creddy_trddc CFX 1 October 30, 2011 05:30
Altering properties of fluid within the domain Nikhil Dani FLUENT 3 December 12, 2008 05:26
How to define Fluid properties as a Function of T Md Hamidur CFX 2 September 12, 2007 16:05


All times are GMT -4. The time now is 22:59.