CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

chtMultiRegionFoam | merging the two regions after solving

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

Like Tree3Likes
  • 1 Post By Bloerb
  • 1 Post By Bloerb
  • 1 Post By Bloerb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2022, 05:11
Default chtMultiRegionFoam | merging the two regions after solving
  #1
New Member
 
Zeinab Abosedaira
Join Date: Mar 2022
Posts: 24
Rep Power: 4
ZeinabM is on a distinguished road
Hello all, I have a multi-region problem between a solid region and a fluid region. I edited the solver for my new problem, but it's the same base of operation.

My problem basically is I am solving for electric potential in solid and fluid regions; each has different permittivity so that's why I am using a solver like chtMultiRegion. When I finish solving, I need to merge the two regions because I need a continuous electric potential field in order to calculate the electric field which is the negative gradient of the electric potential.

So, I need one continuous field for electric potential but I need to solve for each region separately.

I used mapFields utility but the mapped field is not exactly the same as the original one.
ZeinabM is offline   Reply With Quote

Old   May 12, 2022, 09:45
Default
  #2
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
From my point of view you could solve the electric potential as well with a coupling boundary condition.
But since that is not what you are asking:
It sounds like you are limiting yourself to meshing both regions in such a way, that the boundary faces are identical. Why not simply save the unsplit mesh (or merged mesh) and transfer everything to that? Since it is identical.

You can cleanly map every cell center from both region meshes to that. You could use mapFields, or simply copy the contents.
For example create a file called cellNumber in your 0 directory and set these for internalField / well obviously it needs to be as long as your cell size of each region. And view that in paraview. Now you know how those cells are numbered:
Code:
regionA

internalField   nonuniform List<scalar> 
5
(
0
1
2
3
4
);
regionB

internalField   nonuniform List<scalar> 
5
(
0
1
2
3
4
);
region0 / unsplit

internalField   nonuniform List<scalar> 
10
(
0
1
2
3
4
5
6
7
8
9

);
Or use postProcess -writeCellCentres, which will output the x,y,z position of each cell centre.

It should be as easy as just copying both of those into one array.
Bloerb is offline   Reply With Quote

Old   May 12, 2022, 12:06
Default
  #3
New Member
 
Zeinab Abosedaira
Join Date: Mar 2022
Posts: 24
Rep Power: 4
ZeinabM is on a distinguished road
I tried mapFields yes, but it generates a slight difference, so I was thinking of another way.

Concerning the second way of copying the data, maybe I should try it and see the results. It's just I have a geometry with proximity and curvature so It didn't come to my mind that that copying would do the job.

You mentioned that I can calculate the electric field directly even with the two regions are separated with a coupling boundary condition. Can you explain to me how exactly I can do that?
ZeinabM is offline   Reply With Quote

Old   May 13, 2022, 11:26
Default
  #4
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
Is that the case for all mapping methods? Or is it that one can't use the identical mesh method when the cell size differs? Could be...never tested that.



And what i meant was: You could use a coupling boundary condition like temperaturecoupledbaffleMixed. All that boundary condition does is make sure that value and gradient at the coupling face are identical. That should work for the electric field as well. Although you would need to modify it. There is currently no coupling condition that works on arbitrary fields. Or vector/tensorfields.
mikulo likes this.
Bloerb is offline   Reply With Quote

Old   June 21, 2022, 04:29
Default
  #5
New Member
 
Zeinab Abosedaira
Join Date: Mar 2022
Posts: 24
Rep Power: 4
ZeinabM is on a distinguished road
Hello,
I haven't replied in a while. I just wanted to let you know that I used the approach of copying the data, and it now works. Thank you so much.
ZeinabM is offline   Reply With Quote

Old   September 14, 2022, 05:07
Default
  #6
Member
 
Join Date: Nov 2020
Posts: 53
Rep Power: 5
mikulo is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
Is that the case for all mapping methods? Or is it that one can't use the identical mesh method when the cell size differs? Could be...never tested that.



And what i meant was: You could use a coupling boundary condition like temperaturecoupledbaffleMixed. All that boundary condition does is make sure that value and gradient at the coupling face are identical. That should work for the electric field as well. Although you would need to modify it. There is currently no coupling condition that works on arbitrary fields. Or vector/tensorfields.
Hello,

What do you mean by modifying? Do you mean to make another boundary condition or simply use the same boundary condition name but with "kappa = sigma (electrical conductivity) ?

e.g.

type compressible::turbulentTemperatureCoupledBaffleMix ed;
kappa kappa;
Tnbr T;
value $internalField;

change to,

type compressible::turbulentTemperatureCoupledBaffleMix ed;
kappa sigma;
Tnbr phi(electric potential);
value $internalField;

Thank you.

Regards,
Michael
mikulo is offline   Reply With Quote

Old   September 14, 2022, 16:49
Default
  #7
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
Look into other posts of mine. I shared the derivation for this boundary condition.

This BC forces two things, that both regions agree on temperature, and that the heatflux exiting one domain enters the other. Hence this would lead to these:


phi_1=phi_2...so the same phi on the shared wall


sigma_1*grad(phi_1)=-sigma_2*grad(phi_2)
mikulo likes this.
Bloerb is offline   Reply With Quote

Old   September 14, 2022, 21:41
Default
  #8
Member
 
Join Date: Nov 2020
Posts: 53
Rep Power: 5
mikulo is on a distinguished road
Hi Bloerb,

Yeah, I got you. I am just thinking whether is it still necessary to change it or just supply the ones I wrote above. After all, they are the same laplace equations. Thanks by the way!

Regards,
Mike
mikulo is offline   Reply With Quote

Old   September 15, 2022, 11:09
Default
  #9
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
There is no reason to change them function wise. The only thing i could think of is, that they do load the thermo libraries for kappa etc., which your solver might not need. Hence you could simplify them, but that is up to you.
mikulo likes this.
Bloerb is offline   Reply With Quote

Reply

Tags
chtmultiregion, electric field, electric potencial, merge, region

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
Maximum number of iterations exceeded chtmultiregionsimpleFoam Moncef OpenFOAM Running, Solving & CFD 28 July 13, 2020 14:26
problem with Min/max rho tH3f0rC3 OpenFOAM 8 July 31, 2019 09:48
HeatSource BC to the whole region in chtMultiRegionHeater xsa OpenFOAM Running, Solving & CFD 3 November 7, 2016 05:07
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 03:34
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 12:50


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