
[Sponsors] 
CellZones to solve different eq in different zones 

LinkBack  Thread Tools  Search this Thread  Display Modes 
October 15, 2008, 14:36 
Hi forum!
I'm trying to solve

#1 
Senior Member

Hi forum!
I'm trying to solve two different PDE in two zones of my mesh. To be precise, in one zone I have some extra terms that aren't present in the other. I take a look around and it seems that I can do something with cellZones, but, how can I code " if this zone is A then ddt + dudx = something else ddt + dudx +dadx = something else" ? I've allready looked at the various threads on conjugate heat transfer, but it seems that is not my case, because I don't whanto to have patches in betweem of the two zones, I want to solve it continuously, just adding extra terms in some zone. Have a nice day (or night, depending on your country ;)) 

October 16, 2008, 03:51 
Take a look at the rhoPorousSi

#2 
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 1,149
Rep Power: 28 
Take a look at the rhoPorousSimpleFoam solver and the porousZone, porousZones classes. This approach might be applicable for your case too.


October 16, 2008, 12:57 
I've taken a look in rhoPorous

#3 
Senior Member

I've taken a look in rhoPorousSimpleFoam solver and porousZone class, but it seems not to be usefull for me, as these codes work only on fvMatrices, cycling on the zoneCells and for each cell put in the fvMatrix the extra pieces.
In my problem I'm obliged to work with full explicit RK time integration, so I only do fvc::stuff and put it as Right Hand Side in RK. I can't do a cycle on the cell of a zone, I need something that says: "if you're in the A zone use this eq. else use this different one". The stuff made in cht seems similiar, but my problem is that I want to avoid internal patches, I want to solve in a continuous way both the equations, without imposing internal bc (I'm trying to write a particular type of nonrefletting bc based on sponge zones, if I put internal patches I will have internal reflections, so no good!). Now I will try to solve a sum of the two equations in the whole domain, and multiplying the extra terms by a switch that's zero where I want these to disappear, but I know that this is not efficient, as I need the extra terms in a small part of the domain. Cheers, Ivan 

October 20, 2008, 22:55 
Hi Ivan,
As I will be startin

#4 
Super Moderator
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 16 
Hi Ivan,
As I will be starting next month some works on solving exterior problems with LEE I'm very much interested in your approaches. So far I am looking for literature about non reflective b.c. but I still can't determine which technique is best suited to be implemented in OF. Do you have any interesting literature about it, or any comments? Thanks, Takuya 

October 21, 2008, 04:17 
Hi Takuya!
Non reflective b.c

#5 
Senior Member

Hi Takuya!
Non reflective b.c. for aeroacoustics is just a question of philosophy! If you talk with 10 aeroacousticians, they will tell you 10 different things! So, in my opinion, and as resulted from some numerical test we did in my group (with fortran codes), PML is now the best working nrbc. I've implemented the Unsplit Stable PML of Hu, it's easy to find it on the web. Now it works only for uniform mean flow, but it exists a formulation for general mean flow. Moreover, I suppose that PML are the easyest bc that you can implement in OF, as they are NOT bc's! You just solve a different PDF with some absorbing terms in a sponge zone around your farfield, and at the real boundary you put fixed value 0 or zeroGradient according to th characteristic analysis, and that's all! Now the problem for me is that I'm obliged to solve the PML PDF everywhere and put it to zero in the interior domain with a zone switch, so it's very heavy! Next step will be: it's possible to set different PDF in different zones (using for example splitMeshRegin) but do it without putting a patch between the two domains? I would like to do the same as the code do in parallelization, I can accept something like a processor bc between the two domains, not anything physical!! P.S. the reference is: Hu, F. Q., 2001:A stable, perfectly matched layer for linearized Euler equations in unsplit physical variables.J. Comput. Phys., 173, 455480. 

October 21, 2008, 06:01 
Hi Ivan,
Thanks a lot for t

#6 
Super Moderator
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 16 
Hi Ivan,
Thanks a lot for the reference! I had a quick look at the one and indeed looks quite doable. I already have found the general mean flow version (Hu 2005, J. Comput. Phys., 469) but had not found the 2001 one which looks better to start with. As I just have started digging with nonreflective bcs I'm a lot relieved to find at least I'm not in a totally wrong direction. Takuya 

October 21, 2008, 11:56 
Takuya,
I think you're in the

#7 
Senior Member

Takuya,
I think you're in the correct direction. If you have any idea on the multizone approach for PML in OpenFOAM, let's discuss togheter, we will find out some solution! 

June 30, 2011, 11:53 

#8  
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 12 
Quote:
I have to solve a similar problem, i.e. on a certain cellZone I have to solve an equation which includes an additional term. I solved the problem by creating a volScalarField which is "zero" on cellZone A and "1" on cellZone B. With setFields I can initialize the scalar properly. In the solver I add the additional term and multiply it with the scalar. The result is that the additional term is only added on the cellZone B where the scalar is "1". What do you think? Have you solved your problem yet? I know it is quite a long time ago since you posted but maybe you are interested anyway 

January 24, 2019, 04:53 

#9 
Member
AJAY BHANDARI
Join Date: Jul 2015
Location: INDIA
Posts: 57
Rep Power: 7 
Hi all,
I think my post best fits here. I want to solve the continuity equation on the mesh elements of my computational domain. But on one mesh element i want to solve the same continuity equation with some additional terms. Can anybody please suggest something in this regard. How should i start with. Any help will be appreciated. Best Ajay 

March 5, 2019, 06:26 

#10  
New Member
Zhanyuan Wang
Join Date: Sep 2018
Location: China
Posts: 9
Rep Power: 4 
Quote:
If you want to solve different equation which only has different source term , then your method is OK. But i want to solve different equation with different diffusion term and convection term, something like: if zoneA fvm::ddtY + fvm::divY + fvm::laplacianY = source 1 else 0 = 0 in this situation if you simply multiply a cofficience in front of div/laplacian term which probably will be zero , when you run the solver it will break down and give you floating exception error. so how can i achieve my goal...who knows.... I know it has been long time since you answer this question so i m not sure if you can notice my problem, i will be very grateful for anyone who answer my problem . 

October 24, 2019, 09:36 

#11 
New Member
Knut Olafson
Join Date: Jun 2019
Posts: 6
Rep Power: 3 
Has anyone found a solution to Ivans initial question (over the last 11 years..)?
If so, i'm very interested in, since I have quite the similar problem: I want to solve (two) different Systems in (two) different regions of my mesh. Adding some extra terms and multiplying them with zero/one is the way i'm currently going, but this ist not very effective (In one region I've only two equations to solve, in the other one four. With this method, I have to solve the four equations in the whole mesh  and additionally there are some numerical stability issues). So it would be nice to say (as ivan formulated it): in region A solve PDE 1, in region B solve PDE2 Greetings, Knut 

October 24, 2019, 10:58 

#12  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 958
Rep Power: 24 
Quote:
if you are open to anything other than openfoam you could use wildkatze to do it. Its been possible there for last 4 years. This type of thing comes naturally to that solver. 

October 24, 2019, 14:02 

#13 
New Member
Knut Olafson
Join Date: Jun 2019
Posts: 6
Rep Power: 3 
sadly i'm bounded to OF (or: the acoustic solvers I use are bounded to OF)..


October 24, 2019, 17:07 

#14  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 958
Rep Power: 24 
Quote:
This is why when i designed wildkatze the way i did was that user can make any number of sets of regions and then he can also make any number of sets from phases. Now user can create physics model on region sets and phase sets. One can even leave regions unused from mesh. Gives ultimate freedom in terms what is possible. You can even use different turbulence models in each of region for example. 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
[Salome] Definition of cellZones  sradl  OpenFOAM Meshing & Mesh Conversion  2  September 13, 2007 11:27 
FluentMeshToFoam writes too small cellZones  gschaider  OpenFOAM Bugs  0  May 22, 2007 14:57 
[OpenFOAM] What are Zones used for  tj22  ParaView  8  September 5, 2006 06:21 
can I use layering in only any zones?  Rafael  FLUENT  0  June 7, 2005 09:22 
help with grid zones  csertoi_aurel  FLUENT  0  February 4, 2005 13:46 