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

[chtMultiRegionSimpleFoam] Control MRF inside fluid region

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

Like Tree11Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 18, 2017, 06:04
Default
  #21
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thanh,

thank you very much for your reply, also for your idea to mergeMeshes instead of splitMeshRegions!

sitajeje
sitajeje is offline   Reply With Quote

Old   June 18, 2017, 22:31
Default
  #22
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thanh,

Thank you very much first of all for sharing your successful experiences with CHT and MRF together! I have been trying to replicate your case, and your posts helped me a lot.

I couldn't follow through your procedures however. I have a very similar case, a fan is blowing a solid. The fan locates in a MRF region, which has only air as your last post suggests. The solid locates in a connecting domain with both air and the solid itself. I did the following steps:

1. create mesh for the solid
2. make a different folder named as fan with folder "constant" and the folder "system" inside, in order to create the mesh of the MRF region.
3. make another such folder to create the mesh of the air surrounding the solid
4. mergeMeshes to merge all the three meshes together
5. splitMeshRegions -cellZoneOnly -overwrite
6. createPatch -overwrite with the same method as you suggested. The interface between the air (which surrounds the solid) and the MRF region is defined as cyclicAMI
7. topoSet and fvOptions in the system/solid to define a heat source
8. changeDictionary where the corresponding cyclicAMI interfaces are also declared
9.run chtMultiRegionSimpleFoam, and got the error message:
----------------------------------------------------------------------------------------------
--> FOAM FATAL ERROR:
cannot be called for a calculatedFvPatchField
on patch air_bottom of field U in file "/home/haili/OpenFOAM/haili-4.1/run/CHTMRF/0/airRegion/U"
You are probably trying to solve for a field with a default boundary condition.

From function Foam::tmp<Foam::Field<Type> > Foam::calculatedFvPatchField<Type>::gradientIntern alCoeffs() const [with Type = Foam::Vector<double>]
in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 187.

FOAM aborting
----------------------------------------------------------------------------------------------
I checked the constant/polyMesh/boundary, the air_bottom_AMI with type cyclicAMI is well defined, and the original air_bottom was missing. However in the folder 0/airRegion, both the original and the corresponding AMI boundary exist, which might make the error messsage.

I would appreciate if you could suggest me a correction. I couldn't figure it out how to progress. Thank you very much in advance!

Best regards,

sitajeje
sitajeje is offline   Reply With Quote

Old   June 19, 2017, 00:17
Default
  #23
Member
 
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 94
Rep Power: 8
hiuluom is on a distinguished road
The BCs of U was wrong that it was set calculated. You can refer my test case, including MSH mesh file and OF case at here:

https://1drv.ms/f/s!AkLk2AeMilR1g_hc-BZlLtYRo1vOpQ

It will help you to imagine the cht solver with mrf. You can use the mesh and do follow the guide above.
Best
hiuluom is offline   Reply With Quote

Old   June 19, 2017, 00:41
Default
  #24
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thanh,

Another question is how do you use topoSet and fvOptions to make the MRF region please?

Is it possible to first create an entire region of air + MRF with snappyHexMesh and then use topoSet to create the MRF region, finally use createPatch to define the cyclicAMI interfaces? Your experience would very very helpful!

Thank you very much in advance!

sitajeje
sitajeje is offline   Reply With Quote

Old   June 19, 2017, 01:06
Default
  #25
Member
 
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 94
Rep Power: 8
hiuluom is on a distinguished road
You can refer the tutorial of Tobi at the link:
http://www.holzmann-cfd.de/index.php.../snappyhexmesh

after making multi-region mesh with snappy, you can merge mesh and createPatch. All of parameters in that of files you can refer the post case #23
Tobi likes this.
hiuluom is offline   Reply With Quote

Old   June 21, 2017, 11:07
Default
  #26
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thanh,

Thank you very much for your files, this is of great help!

Your configuration updated my knowledge about CHT solvers. It is surprising for me that you didn't have the changeDictionaryDict. How do you set the boundary conditions between solid and fluid please? Do you have a ./Allrun script where commands are listed? It would helped me greatly.

I changed my procedures to the following:
1. create mesh for the air
2. make a different folder named as fan with folder "constant" and the folder "system" inside, in order to create the mesh of the MRF region.
3. make another such folder to create mesh of a solid
4. mergeMeshes to merge all the three meshes together
5. createPatch -overwrite with the same method as you suggested. The interface between the air (which surrounds the solid) and the MRF region is defined as cyclicAMI
6. splitMeshRegions -cellZoneOnly -overwrite
7. changeDictionary where the corresponding cyclicAMI interfaces are also declared, and got the following error message:

--> FOAM FATAL ERROR:
Illegal neighbourPatch name fan_bottom_AMI
Valid patch names are
3
(
air_bottom
air_lateral
air_top_AMI
)
From function virtual Foam::label Foam::cyclicAMIPolyPatch:: neighbPatchID() const
in file AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C at line 706.

FOAM exiting

I used to use GAMBIT as well. Now I only use OpenFOAM for mesh. The procedure of mesh generation is different. My airRegion, fanRegion and solidRegion were created during mesh generation by blockMesh/snappyHexMesh. After splitMeshRegions, the only difference induced is the AMI boundary conditions created by creatPatch. Thank you very much for your method to create the MRF region by fvOptions. I put it in system/fanRegion/.

I would appreciate if you could give me some suggestions. Thank you very much in advance!

Best regards,

sitajeje
sitajeje is offline   Reply With Quote

Old   June 21, 2017, 14:23
Default
  #27
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thanh,

I notice that you said in order to createPatch for AMI boundaries, you need to mergeMeshes v3 and v4. Is it necessary to combine the regions on both sides of the AMI boundaries into one region?

I could create the MRF region and the air region with the same region name, so that after mesh they build only one region. In this case, I can run changeDictionary successfully. The AMI boundaries appear in both constant/polyMesh and the folders for each region, such as constant/airRegion/polyMesh.

The difficulty with this method is that, I must create a cellSet (or cellZone) with boundaries of the fan region, in order to create the MRF region. I didn't figure out how to amend your topoSet for vol_MRF for my application. Do you have any suggestions for me? I would greatly appreciate!

Thank you very much in advance!

sitajeje
sitajeje is offline   Reply With Quote

Old   June 22, 2017, 10:22
Default
  #28
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thahn,

I could use cylinderToCell in system/airRegion/topoSetDict to create the cellZoneSet for the MRFRegion. I am still testing whether the AMI boundaries are still functional. I couldn't progress further, because I met the following error message in log.chtMultiRegionSimpleFoam:

--> FOAM FATAL ERROR:
' not type 'mappedPatchBase'
for patch airRegion_to_solidRegion of field T in file "/home/haili/OpenFOAM/haili-4.1/run/CHTMRF/0/airRegion/T"

From function
Foam::compressible::turbulentTemperatureCoupledBaf fleMixedFvPatchScalarField::turbulentTemperatureCo upledBaffleMixedFvPatchScalarField(const Foam::fvPatch&, const Foam:imensionedField<double, Foam::volMesh>&, const Foam::dictionary&)
in file turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScala rField.C at line 96.

FOAM exiting

I used changeDictionary to set the boundary conditions for the interface between solid and air. Before this command (after the splitMeshRegions), the boundary condition for this interface in 0/airRegion/T is mappedPatchBase. After this command, it is changed to compressible::turbulentTemperatureCoupledBaffleMix ed, as in your 0/vol_fluid/T. However the above mentioned error message appeared.

I would appreciate greatly, if you could give me some suggestions! Thank you very much in advance!

sitajeje
sitajeje is offline   Reply With Quote

Old   June 22, 2017, 23:06
Default
  #29
Member
 
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 94
Rep Power: 8
hiuluom is on a distinguished road
Hi sitajeje,

My mesh, multi-region mesh, created by snappyHexMesh. It needs stl file for wing, solid, domain and MRF region. The method makes mesh that you can refer OF tut or Tobi website. Because chtMultiRegions solver have to split the mesh into small regions, including MRF region, I adjust mesh again that mean MRF is merged into fluid regions. Besides, the interface between MRF and fluid is created by the split mesh regions, so I use createPatch change it to cyclicAMI that fluid flow can through it.

Otherwise, yo do not need to make a MRF region in snappy step. You can do it later when snappy finished. The way you mentioned using cylinder MRF regions with topoSet for fluid air region is ok. If you use this way, the AMI face do not create. Therefore, you do not need to run createPatch.

Some errors in your case may be come from the BCs, you try to change 0 to 0.org before snappy or split mesh.

Best,
Thanh
hiuluom is offline   Reply With Quote

Old   June 25, 2017, 08:57
Default
  #30
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thanh,

Thank you very much for your reply! I still do not understand completely. After you merge the MRF cellZone and the cellZone region, how did you make them as one cellZone while keeping the definition of the MRF cellZone, so that you can define the MRF region by cellZone "vol_MRF" in topoSetDict in system/vol_fluid?

If you didn't make the two regions into one cellZone, did you have problem while running changeDictionaryDict? I got the error message about the Illegal neighbourPatch name.

I ran your case but didn't work through. I found that the MRF in star-CCM+ is not compatible for CHT, because only fluid domain is allowed. Are you familiar with other commercial software, whether some can make it?

http://mdx2.plm.automation.siemens.c...ding-radiation

Best,
sitajeje
sitajeje is offline   Reply With Quote

Old   June 27, 2017, 10:56
Default
  #31
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,258
Blog Entries: 6
Rep Power: 39
Tobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by hiuluom View Post
I tested with simpleFoam OF2.2.x. Both of models take from tutorial.
MRF and AMI 2D model ran with simpleFoam. The result pressure, velocity are not difference.
So I think that if I make AMI ratotating for solver not support dynamic mesh, the value do not effect when compares with MRF. In chtMultiRegionSimple does not support dynamic mesh, I can make AMI face as mention above but it doesn't have a mesh flux, interpolation between station and rotation mesh.

I still don't get the point why you use AMI? AMI is an boundary condition for interpolating between static and rotating meshes and as you said in steady state simulations there is no moving mesh.

In my opinion - as already mentioned:
  • Use steady state with MRF
  • Use transient AMI and rotating and stationary mesh
Mixing MRF + AMI is in my opinion senseless and will just introduce more computational effort (mapping / interpolation) even if there is not much to interpolate but you will do it. However, maybe I am missing something :/
__________________
Keep foaming,
Tobias Holzmann

Last edited by Tobi; June 28, 2017 at 04:48.
Tobi is offline   Reply With Quote

Old   June 28, 2017, 00:15
Default
  #32
Member
 
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 94
Rep Power: 8
hiuluom is on a distinguished road
Quote:
Originally Posted by Tobi View Post
I still don't get the point why you use AMI? AMI is an boundary condition for interpolating between static and rotating meshes and as you said in steady state simulations there is no moving mesh.

In my opinion - as already mentioned:
  • Use steady state with MRF
  • Use transient AMI and ratating and stationary mesh
Mixing MRF + AMI is in my opinion senseless and will just introduce more computational effort (mapping / interpolation) even if there is not much to interpolate but you will do it.
Hi Tobi,

The interface between air fluid zone and MRF which were made by splitMeshRegion command can be used cyclic instead of AMI. Using AMI as you told that make sense.
The purpose that fluid flow can go through internal (cyclic face) with MRF for steady case.

Otherwise, we can use stichMesh in order to change wall to internal, so it become real MRF steady.

Best,
Tobi likes this.
hiuluom is offline   Reply With Quote

Old   June 28, 2017, 00:48
Default
  #33
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 12
student666 is on a distinguished road
It's a bit a I'm not using rotating zone, but if I remember properly:

When you use SHM for meshing and you define a cylindrical zone as refinement (with no specification it has to become a cellZone), SHM will generate a cellSet (or you have to define it, I can't remember) according to your dict.
This cellSet can be used by fvOptions as momentum source for you MRF source.
In this way of proceeding, there is no need to define any AMI interfaces, as SHM has the advantage to keep faces matching perfectly, not overlapping faces, no interpolation is needed.

Different is the case, if you use mergeMesh approach, as (maybe) your geometry is too complicated to be meshed by a unique STL starting file.
By this way you have to use AMI interfaces, because perfect matching is not more guaranteed at the interface between rotating and stationary zone, and interpolation is needed and you should perform a good refinement job, but as already said computational effort increase and you may also face stability and accuracy issues.

Regards
Tobi and sitajeje like this.
student666 is offline   Reply With Quote

Old   June 28, 2017, 04:45
Default
  #34
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,258
Blog Entries: 6
Rep Power: 39
Tobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Than and M.C.,

after I asked this question a few times, it is the first time that it became clear. Thank you for the hint. However, I guess you should be able (even for complex) geometries and sHM, to make baffles (as Than already mentioned) instead of using AMI or if even possible, just mesh the interface correct without splitting the mesh and using any cyclic boundary condition. But maybe it is an easier way using any kind of cyclic BC.

Thank you both again.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 30, 2017, 16:51
Default
  #35
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Tobias,

Thank you very much first of all for your tutorial Gin Tonic (CHT) on your website!

I have the same problem that the computation domains do not fill all the background mesh. I am trying to use your method as in your tutorial, but met a problem. I notice that the following command changes fill the entries of boundaryField in 0/iceCube1/p and T.
changeDictionary -region iceCube1

I used the same command, but the p and T files in my 0/air folder remains empty in the boundaryField. I would appreciate if you could give me some hints! If you need any other information, please don't hesitate to let me know.

Thank you very much in advance!

sitajeje
sitajeje is offline   Reply With Quote

Old   July 1, 2017, 09:08
Default
  #36
Member
 
Join Date: Sep 2016
Posts: 63
Rep Power: 5
sitajeje is on a distinguished road
Hallo Thahn,

I finally figured it out: my "air_to_solid" boundary should have type "mappedWall", if "mergeMesh" and then "splitMeshRegions -cellZonesOnly" are used to create regions of the "air" and "solid". I have to do it this way, because my "solid" and "air" regions do not fill all the background mesh. With the two meshes generated separately, I can also optimize the mesh separately.

I find the way that Star CCM+ does for the MRF and CHT is more physical, because the characteristic time scale of the airflow in the MRF region, 1 period of rotation of ca. 16ms, is much shorter than the time of heat transfer, in my case ca. 10min. I would prefer to use a unified average value to displace the nonuniform velocity at the boundary of the MRF region.

Best regards,

sitajeje
sitajeje is offline   Reply With Quote

Old   July 12, 2017, 00:22
Question
  #37
Member
 
王莹
Join Date: May 2017
Posts: 45
Rep Power: 4
Alisa_W is on a distinguished road
Quote:
Originally Posted by hiuluom View Post
I tested with simpleFoam OF2.2.x. Both of models take from tutorial.
MRF and AMI 2D model ran with simpleFoam. The result pressure, velocity are not difference.
So I think that if I make AMI ratotating for solver not support dynamic mesh, the value do not effect when compares with MRF. In chtMultiRegionSimple does not support dynamic mesh, I can make AMI face as mention above but it doesn't have a mesh flux, interpolation between station and rotation mesh.


Here is my setup case fvOptions file:

MRF:

Code:
MRF1
{
    type            MRFSource;
    active          true;
    selectionMode   cellZone;
    cellZone        rotor;

    MRFSourceCoeffs
    {
        origin      (0 0 0);
        axis        (0 0 1);
        omega       104.72;
    }
}
AMI:

Code:
MRF1
{
    type            MRFSource;
    active          true;
    selectionMode   cellZone;
    cellZone        rotor;
    
    MRFSourceCoeffs
    {
    	nonRotatingPatches (AMI1 AMI2);
        origin      (0 0 0);
        axis        (0 0 1);
        omega       104.72;
    }
}
You can review in the following figures.
Hi hiuluom,
I am using AMI & MRF recently and the setup of my MRFpropertities files is like the under one. What I can't understand is why you set the AMI1&AMI2 asnonRotatingPatches ?
Alisa_W is offline   Reply With Quote

Old   July 31, 2017, 05:31
Default
  #38
Member
 
Huynh Phong Thanh
Join Date: Aug 2013
Location: Ho Chi Minh City
Posts: 94
Rep Power: 8
hiuluom is on a distinguished road
Quote:
Originally Posted by Alisa_W View Post
Hi hiuluom,
I am using AMI & MRF recently and the setup of my MRFpropertities files is like the under one. What I can't understand is why you set the AMI1&AMI2 asnonRotatingPatches ?
That are interface of rotating zone and freeze zone. You can refer the tutorial as pimpleDymFoam to understand AMI.
hiuluom is offline   Reply With Quote

Old   October 21, 2019, 08:51
Default
  #39
New Member
 
Join Date: Oct 2016
Posts: 1
Rep Power: 0
FDelic is on a distinguished road
Quote:
Originally Posted by hiuluom View Post
The BCs of U was wrong that it was set calculated. You can refer my test case, including MSH mesh file and OF case at here:

https://1drv.ms/f/s!AkLk2AeMilR1g_hc-BZlLtYRo1vOpQ

It will help you to imagine the cht solver with mrf. You can use the mesh and do follow the guide above.
Best

Can you please reupload the link?
It doesn't seem to be working.
FDelic is online now   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
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 07:08
Problem with an old Simulation FrankW CFX 3 February 8, 2016 05:28
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 05:39
chtMultiRegionFoam connection between solid and fluid region of heat exchanger ahab OpenFOAM 0 March 2, 2015 13:19
meshing F1 front wing Steve FLUENT 0 April 17, 2003 13:37


All times are GMT -4. The time now is 05:36.