CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   chtMultiRegionFoam BC for fluid-fluid zones (http://www.cfd-online.com/Forums/openfoam-solving/109280-chtmultiregionfoam-bc-fluid-fluid-zones.html)

Hanzo November 14, 2012 06:13

chtMultiRegionFoam BC for fluid-fluid zones
 
Hello,

I try to set-up a case using chtMultiRegionFoam.
Later the goal is to include chemistry but at the moment I have a rather simple problem:

In the tutorial for MultiRegionHeater there is always a solid region connected to a fluid region. Therefore velocity at the interface boundaries such as
topAir_to_heater becomes simply (0 0 0).

When I have a case with two fluid zones neighbouring each other, what could be a good BC for velocity, pressure and temperature between these fluid zones? I tried

- BC "calculated": results in the following error
gradientInternalCoeffs cannot be called for a calculatedFvPatchField

- BC "inletOutlet": divergence after a few steps

I also tried some other combinations but I cannot figure out good one.

Thanks for any hints.

Linse November 26, 2012 04:27

Fluid-Fluid BC
 
Hello Hanzo,

unfortunately there is no BC or interface yet for this problem within OpenFOAM. That's why You did not find any tutorial case for something like this! ;-)
Since quite some time I am working on a solution for that problem (low C++ skills are no advantage), but I think I still will need some days or weeks until I can release some code for something like that...

I'll keep you posted!

Thus, what I would suggest for the moment for going on: Try to get the chemistry part running! You can run the chtMultiRegion-solvers for a single zone if you first produce the geometry for the full domain and put the complete polyMesh into the folder for the single region you tell cht to solve. Of course, this puts ad absurdum the "multiregion"-part of the name, but it helps checking if the solver is capable to do what you want at all...

Cheers,
Bernhard

Hanzo November 26, 2012 22:53

Thank you for your advise Bernhard.

At the moment I am including chemFoam functionality in the multiZone framework. And make progress little by little.

About the BC:

Could you give me an idea what the main problem for an internal BC between two (say in the beginning) exact same fluids is? Isn't there an analogue treatment possible like in a decomposed case where fluid also passes some internal boundaries which the fluid should not "see" (the boundary from one decomposition region to another)?

Or a different approach for my special case:
Solve the fluid flow in the usual single domain setting and then compute chemistry for each region using the flow field. I wonder how I would then give each chemisty region it's part of the fluid properties. Any idea on that?

Linse November 27, 2012 05:58

To be honest: I did not look into the decomposition methods too much because right from the beginning it was clear that this would not be sufficient for my goals.

But concerning your second idea: You might want to look into _fvSubMeshSet_ which is available in the ext-release of OpenFoam. (I do not know if by now it found its way into the official release as well!)
This tool allows to compute some equations for the complete domain (e.g. basic flow equations) and to compute additional equations on parts of the domain. If you find a way to do the second step multiple times for different parts/regions, maybe that would help you as well? The backdrop: It relies heavily on mapping which causes rather high resource demand...

ZKW November 27, 2012 06:13

1 Attachment(s)
Thanks for the reply Linse,
& Thanks Hanzo for starting a new thread on this topic. I hope it is relevant to post the same here.

I am working on the same topic.I am trying to use the same setup (chtMultiRegionSimpleFoam) for a Closed loop system with a Fan , Initially i have set both the regions to Fluid ( air, fan )

Please take a look if
http://www.cfd-online.com/Forums/ope...tml#post393624

Am I using the correct Boundary condition ??

I also would like to have some help if using the fan or the fanPressure patch a correct option for MultiRegion Cases.
OpenFOAM-2.1.x/src/finiteVolume/fields/fvPatchFields/derived/fanPressure

If either of you have any suggestions, they are welcome.

Thanks & Regards
Unni

Hanzo November 27, 2012 21:59

Quote:

Originally Posted by Linse (Post 394350)
To be honest: I did not look into the decomposition methods too much because right from the beginning it was clear that this would not be sufficient for my goals.

Sounds interesting. Could you give an idea on what kind of BC you are working on?

Quote:

Originally Posted by Linse (Post 394350)
But concerning your second idea: You might want to look into _fvSubMeshSet_ which is available in the ext-release of OpenFoam. (I do not know if by now it found its way into the official release as well!)
This tool allows to compute some equations for the complete domain (e.g. basic flow equations) and to compute additional equations on parts of the domain. If you find a way to do the second step multiple times for different parts/regions, maybe that would help you as well? The backdrop: It relies heavily on mapping which causes rather high resource demand...

Thanks for the hint. I will have a look at fvSubMeshSet. Apart from the ressources demand it sounds quite promising.


Quote:

Originally Posted by ZKW (Post 394353)
Please take a look if
http://www.cfd-online.com/Forums/ope...tml#post393624

Am I using the correct Boundary condition ??

I also would like to have some help if using the fan or the fanPressure patch a correct option for MultiRegion Cases.
OpenFOAM-2.1.x/src/finiteVolume/fields/fvPatchFields/derived/fanPressure

I like the idea about the cyclic boundary conditions in the thread you are mentioning. Did you make any good experiences with that?

Quote:

Originally Posted by ZKW (Post 394353)
Am I using the correct Boundary condition ??

Unfortunately, I cannot say anything about the fanPressure patch. Did you ever try to setup a rather simple case using the fanPressure patch and compare to experimental or other simulation data?

Hanzo December 5, 2012 01:06

5 Attachment(s)
I now have a first version of a multiRegionChemistry Solver.
So far only a transient Diffusion-Reaction equation is solved for all the
species. Chemistry seems to work fine so far, but I am now at the point where I need to have Boundary conditions for two identical phases. I would like to couple the boundary conditions of a species of neighbouring regions.

The following pictures illustrates what I am looking for:

Initial conditions at t=0s : Green color = Species A, red color = species B, white boxes are two different domains
http://www.cfd-online.com/Forums/att...1&d=1354683007

as species A and B start to diffuse in space, the reaction for generating species C begins ( simply A + B -> C)

As can be seen on the following two pictures which show slices through the two domains

Concentration of species C at t=0s:
http://www.cfd-online.com/Forums/att...1&d=1354683019

at t=5s
http://www.cfd-online.com/Forums/att...1&d=1354683027

at t = 25s
http://www.cfd-online.com/Forums/att...1&d=1354683033

As can be clearly seen, the boundary values of the left region have no influence of species C on the right region. This boundary is defined as

Code:

    cyto_to_memb
    {
        type            directMappedWall;
        nFaces          169;
        startFace      6929;
        sampleMode      nearestPatchFace;
        sampleRegion    memb;
        samplePatch    memb_to_cyto;
        offsetMode      uniform;
        offset          (0 0 0);
    }

and becomes the follwing in the 0 directory

Code:

    cyto_to_memb
    {
        type            zeoGradient;
    }

So I hoped that the species diffuse out of the left region with a zero gradient into the right region. But the coupling is not performed.

The follwing picture is a lineplot through the middle of the two regions and shows the same thing

http://www.cfd-online.com/Forums/att...1&d=1354683063

Quote:

Originally Posted by Linse (Post 394142)
Since quite some time I am working on a solution for that problem (low C++ skills are no advantage), but I think I still will need some days or weeks until I can release some code for something like that...

I'll keep you posted!


Bernhard, did you make some progress? If not I will now start to program a similar BC like
compressible::turbulentTemperatureCoupledBaffleMix ed
which will hopefully become something like
speciesCoupledBaffleMixed.

I guess a generalization to other volScalarField values or maybe even volVectorField values (e.g. for a velocity - velocity coupling in chtMultiRegionFoam) should be similar.



Update Edit:

Okay, was easier than I thought. I used the compressible::turbulentTemperatureCoupledBaffleMix ed and wrote a speciesCoupledBaffleMixed which couples the interface values. Actually, it can be an arbitrary scalar.
I just take the geometric mean of the nearest scalar value of the internal region and the nearest scalar from the neighbouring region and apply a zero gradient.

Results look like the following

(have to post a new reply for the additional pictures :-/ )

Hanzo December 5, 2012 05:02

4 Attachment(s)
though it looks like I have a time step dependency for the chemistry :eek: So I will have a look on this later.

I will clean up the code and also consider extending it to velocityCoupledBaffleMixed.

C at t=0s
http://www.cfd-online.com/Forums/att...1&d=1354697973

t= 5s
http://www.cfd-online.com/Forums/att...1&d=1354697982

t=10s
http://www.cfd-online.com/Forums/att...1&d=1354697988

t=20s
http://www.cfd-online.com/Forums/att...1&d=1354697996

yhaomin2007 July 12, 2015 18:54

Hi, Hanzo

It seems your BC is working well for velocity. I am also working on a similar problem. Would you like to share your code here? Thanks in advance.

GSchwab February 10, 2016 09:29

Quote:

Originally Posted by Linse (Post 394142)
unfortunately there is no BC or interface yet for this problem within OpenFOAM. That's why You did not find any tutorial case for something like this! ;-)
Since quite some time I am working on a solution for that problem (low C++ skills are no advantage), but I think I still will need some days or weeks until I can release some code for something like that...

Hi,

i am currently working on the same issue. I want to simulate a tank (with solid walls) filled with a fluid and a gas layer on top.

In the meanwhile, is there a working BC/solution available for the MultiregionFoam for liquid (fluid/gas) interfaces?

Thanks for your help in advance!


All times are GMT -4. The time now is 18:49.