CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] SplitMeshRegions deletes patches on stl file

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 10, 2019, 03:54
Default SplitMeshRegions deletes patches on stl file
  #1
Member
 
Owais Shabbir
Join Date: May 2019
Posts: 48
Rep Power: 6
Owais Shabbir is on a distinguished road
Dear All,


I am trying to develop a chtmultiregionsimplefoam case and it consists of a battery and a casing in the fluid domain.

After SnappyHexMesh in my constant/polyMesh/boundary file I have following boundaries:
inlet
outlet
walls
batteries
casing


After I performed splitMeshRegions -cellZonesOnly -overwrite I am only left with
inlet

outlet
walls
and in the <region>/constant/polyMesh/boundary for lets say batteries, I have:
batteries_to_casing
batteries_to_fluid
I cant find batteries or casing boundary patch anymore which unables me to set a boundary condition on either battery or casing.

I have tried topoSet to collect the faceZones and use createPatch for it but it doesn't work because createPatch is for external faces only.
Is there a way (if possible a simpler one) to solve this problem?

Any help will be appreciated

Thanks
OS
Owais Shabbir is offline   Reply With Quote

Old   August 12, 2019, 03:22
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,070
Rep Power: 26
Yann will become famous soon enough
Hello Owais,

When you run splitMeshRegions, coupled patches are created at the interfaces between the regions.

In your case, it means your batteries and casing patches should be renamed according to the regions names sharing this interface.

You said in batteries/constant/polyMesh/boundary, you have
  • batteries_to_casing
  • batteries_to_fluid
This is normal. In fluid/constant/polyMesh/boundary you should also have something like :
  • fluid_to_casing
  • fluid_to_batteries
fluid_to_batteries and batteries_to_fluid are the same patch. The first one belongs to the fluid region, the second one belongs to the batteries region and these patches are coupled together. You have to set boundary conditions for these patches in 0/fluid and 0/batteries directories.

You may have a constant/polyMesh directory left, but it is useless since you are going to work only with the regions and each one has its own directory containing its own mesh (regionName/constant/polyMesh)

Cheers,
Yann
Owais Shabbir likes this.

Last edited by Yann; August 12, 2019 at 03:24. Reason: clarification
Yann is offline   Reply With Quote

Old   August 12, 2019, 04:02
Default
  #3
Member
 
Owais Shabbir
Join Date: May 2019
Posts: 48
Rep Power: 6
Owais Shabbir is on a distinguished road
Hi Yann,

you are quite right, I have just moved to chtMultiRegion and therefore, I was unaware of the dictionary fvOptions which is utilised to introduce heat in regions.

Thanks
Owais
Owais Shabbir is offline   Reply With Quote

Old   August 13, 2019, 03:28
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,070
Rep Power: 26
Yann will become famous soon enough
Hi Owais,


You're welcome, switching to chtMultRegion can be a bit confusing since every region has its own setup.


Just to be clear: fvOptions is not related to chtMultiRegion. You can use it with any solver and it has a lot of different model to add source terms / constraints in your simulation such as porosity, heat exchanger, joule heating, rotor disk models, quantity source, limiting temperature or velocity etc...


It is indeed a great way to add a heat source in a case.




Yann
Owais Shabbir likes this.
Yann is offline   Reply With Quote

Old   August 13, 2019, 04:06
Default regions created due to checkMesh
  #5
Member
 
Owais Shabbir
Join Date: May 2019
Posts: 48
Rep Power: 6
Owais Shabbir is on a distinguished road
Hi Yann,

I noticed that there were multiple regions (region0,region1...,region31) after I ran the command
Code:
checkMesh -region batteries
Code:
  <<Writing region information to "0/cellToRegion"
  <<Writing region 0 with 56586 cells to cellSet region0
  <<Writing region 1 with 58973 cells to cellSet region1
  <<Writing region 2 with 86854 cells to cellSet region2
  <<Writing region 3 with 85248 cells to cellSet region3
  <<Writing region 4 with 105712 cells to cellSet region4
  <<Writing region 5 with 116805 cells to cellSet region5
  <<Writing region 6 with 77349 cells to cellSet region6
  <<Writing region 7 with 95958 cells to cellSet region7
  <<Writing region 8 with 115034 cells to cellSet region8
  <<Writing region 9 with 78722 cells to cellSet region9
  <<Writing region 10 with 92825 cells to cellSet region10
  <<Writing region 11 with 117140 cells to cellSet region11
  <<Writing region 12 with 85406 cells to cellSet region12
  <<Writing region 13 with 98944 cells to cellSet region13
  <<Writing region 14 with 116975 cells to cellSet region14
  <<Writing region 15 with 74450 cells to cellSet region15
  <<Writing region 16 with 77726 cells to cellSet region16
  <<Writing region 17 with 102233 cells to cellSet region17
  <<Writing region 18 with 85248 cells to cellSet region18
  <<Writing region 19 with 105712 cells to cellSet region19
  <<Writing region 20 with 119880 cells to cellSet region20
  <<Writing region 21 with 77349 cells to cellSet region21
  <<Writing region 22 with 95958 cells to cellSet region22
  <<Writing region 23 with 120105 cells to cellSet region23
  <<Writing region 24 with 78575 cells to cellSet region24
  <<Writing region 25 with 92608 cells to cellSet region25
  <<Writing region 26 with 114226 cells to cellSet region26
  <<Writing region 27 with 85469 cells to cellSet region27
  <<Writing region 28 with 98685 cells to cellSet region28
  <<Writing region 29 with 76841 cells to cellSet region29
  <<Writing region 30 with 76376 cells to cellSet region30
  <<Writing region 31 with 78162 cells to cellSet region31
created since my batteries were not connected! Adding a cross-section picture to elaborate more. (yellow = batteries; green = casing; blue = fluid)
I copied the fvOptions from coolingSphere tutorial since it talks about the fixedPower

Now each of the yellow box is dissipating heat of power 1.25W.
Code:
fixedPower
{
    type            scalarSemiImplicitSource;
    active          yes;
    selectionMode   all;

    volumeMode      absolute;

    power           40;          // Set power (W)

    injectionRateSuSp
    {
        e           ($power 0);
        h           ($power 0);
    }
}
1) Would this be a correct way to add it since now multiple regions are created?
2) should the power be 1.25W instead of 40?
3) what is e and h?
4) I am running the simulation with the 40W but simulation is taking extremely long for the Temperature to change. Each step drops the T_batteries_max by 2e-5 C. Is there a way to speed it up?
Attached Images
File Type: jpg fvOptions.jpg (47.1 KB, 12 views)
Owais Shabbir is offline   Reply With Quote

Old   August 13, 2019, 05:11
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,070
Rep Power: 26
Yann will become famous soon enough
Hi Owais,

Well it depends on what you want to achieve with this simulation. If you're interested in the whole battery pack as one region, I don't think it's a problem if the batteries are not connected.

If I understand it right, in your fvOptions your specified a 40W power for the batteries region. If you have 32 batteries in your pack, you are going to have 40/32=1.25W for each battery, this is exactly what you define in the fvOptions file.

If you want to have 40W for each battery, you have to set 1280W for the whole pack.

Another way of dealing with that is to use the specific volumeMode instead of absolute in order to define a power density (W/m3)

Have a look at the semiImplicitSource.H header for details. (I don't know which version you're using, I've linked the OpenFoam-7 one)

e is the internal energy and h is the enthalpy. Which one is solved depends on your region setup. Have a look at the thermophysicalProperties documentation.

In your example, the fvOptions file is written in order to work with both internal energy and enthalpy. Lets say your case is set up to work with internal energy, you could just write :

Code:
fixedPower
{
    type            scalarSemiImplicitSource;
    active          yes;
    selectionMode   all;

    volumeMode      absolute;

    injectionRateSuSp
    {
        e           (40 0);

    }
}
About your simulation speed, you can check your fvSolution (in each region!), especially the relaxationFactors. try to have a relaxationFactor for e or h equal or close to 1 since under relaxing the energy equation can really slow down the temperature convergence.
Yann is offline   Reply With Quote

Reply

Tags
chtmultiregionsimplefoam, splitmeshregions, toposet


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
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 14 November 18, 2020 16:18
OpenFoam "Permission denied" and "command not found" problems. iyidaniel@yahoo.co.uk OpenFOAM Running, Solving & CFD 11 January 2, 2018 06:47
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 12:41
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44


All times are GMT -4. The time now is 20:56.