|
[Sponsors] |
chtMultiRegionFoam | merging the two regions after solving |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 12, 2022, 06:11 |
chtMultiRegionFoam | merging the two regions after solving
|
#1 |
New Member
Zeinab Abosedaira
Join Date: Mar 2022
Posts: 24
Rep Power: 4 |
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. |
|
May 12, 2022, 10:45 |
|
#2 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
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 ); It should be as easy as just copying both of those into one array. |
|
May 12, 2022, 13:06 |
|
#3 |
New Member
Zeinab Abosedaira
Join Date: Mar 2022
Posts: 24
Rep Power: 4 |
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? |
|
May 13, 2022, 12:26 |
|
#4 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
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. |
|
June 21, 2022, 05:29 |
|
#5 |
New Member
Zeinab Abosedaira
Join Date: Mar 2022
Posts: 24
Rep Power: 4 |
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. |
|
September 14, 2022, 06:07 |
|
#6 | |
Member
Join Date: Nov 2020
Posts: 53
Rep Power: 6 |
Quote:
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 |
||
September 14, 2022, 17:49 |
|
#7 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
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) |
|
September 14, 2022, 22:41 |
|
#8 |
Member
Join Date: Nov 2020
Posts: 53
Rep Power: 6 |
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 |
|
September 15, 2022, 12:09 |
|
#9 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
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.
|
|
Tags |
chtmultiregion, electric field, electric potencial, merge, region |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Maximum number of iterations exceeded chtmultiregionsimpleFoam | Moncef | OpenFOAM Running, Solving & CFD | 28 | July 13, 2020 15:26 |
problem with Min/max rho | tH3f0rC3 | OpenFOAM | 8 | July 31, 2019 10:48 |
HeatSource BC to the whole region in chtMultiRegionHeater | xsa | OpenFOAM Running, Solving & CFD | 3 | November 7, 2016 06:07 |
pisoFoam with k-epsilon turb blows up - Some questions | Heroic | OpenFOAM Running, Solving & CFD | 26 | December 17, 2012 04:34 |
Error while running rhoPisoFoam.. | nileshjrane | OpenFOAM Running, Solving & CFD | 8 | August 26, 2010 13:50 |