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

CellZones to solve different eq in different zones

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

Like Tree4Likes
  • 1 Post By ivan_cozza
  • 2 Post By Anne Lincke
  • 1 Post By knutolafson

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2008, 14:36
Default Hi forum! I'm trying to solve
  #1
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
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 ;-))
ivan_cozza is offline   Reply With Quote

Old   October 16, 2008, 03:51
Default Take a look at the rhoPorousSi
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,679
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Take a look at the rhoPorousSimpleFoam solver and the porousZone, porousZones classes. This approach might be applicable for your case too.
olesen is offline   Reply With Quote

Old   October 16, 2008, 12:57
Default I've taken a look in rhoPorous
  #3
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
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 non-refletting 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
Mojtaba.a likes this.
ivan_cozza is offline   Reply With Quote

Old   October 20, 2008, 22:55
Default 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: 20
7islands is on a distinguished road
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
7islands is offline   Reply With Quote

Old   October 21, 2008, 04:17
Default Hi Takuya! Non reflective b.c
  #5
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
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 nr-bc.
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 far-field, 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, 455-480.
ivan_cozza is offline   Reply With Quote

Old   October 21, 2008, 06:01
Default 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: 20
7islands is on a distinguished road
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
7islands is offline   Reply With Quote

Old   October 21, 2008, 11:56
Default Takuya, I think you're in the
  #7
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
Takuya,
I think you're in the correct direction.
If you have any idea on the multi-zone approach for PML in OpenFOAM, let's discuss togheter, we will find out some solution!
ivan_cozza is offline   Reply With Quote

Old   June 30, 2011, 11:53
Default
  #8
Senior Member
 
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 15
Anne Lincke is on a distinguished road
Quote:
Originally Posted by ivan_cozza View Post
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 non-refletting 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
Dear Ivan,

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
Amir and Ujjwal Chetan like this.
Anne Lincke is offline   Reply With Quote

Old   January 24, 2019, 04:53
Default
  #9
Member
 
AJAY BHANDARI
Join Date: Jul 2015
Location: INDIA
Posts: 57
Rep Power: 10
AJAY BHANDARI is on a distinguished road
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
AJAY BHANDARI is offline   Reply With Quote

Old   March 5, 2019, 06:26
Default
  #10
New Member
 
Zhanyuan Wang
Join Date: Sep 2018
Location: China
Posts: 9
Rep Power: 7
Zhanyuan Wang is on a distinguished road
Quote:
Originally Posted by Anne Lincke View Post
Dear Ivan,

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
Hi Anne,
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 .
Zhanyuan Wang is offline   Reply With Quote

Old   October 24, 2019, 09:36
Default
  #11
New Member
 
Knut Olafson
Join Date: Jun 2019
Posts: 6
Rep Power: 6
knutolafson is on a distinguished road
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
knutolafson is offline   Reply With Quote

Old   October 24, 2019, 10:58
Default
  #12
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by knutolafson View Post
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

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.
arjun is offline   Reply With Quote

Old   October 24, 2019, 14:02
Default
  #13
New Member
 
Knut Olafson
Join Date: Jun 2019
Posts: 6
Rep Power: 6
knutolafson is on a distinguished road
sadly i'm bounded to OF (or: the acoustic solvers I use are bounded to OF)..
arjun likes this.
knutolafson is offline   Reply With Quote

Old   October 24, 2019, 17:07
Default
  #14
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by knutolafson View Post
sadly i'm bounded to OF (or: the acoustic solvers I use are bounded to OF)..
Yaa.


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.
arjun is offline   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
[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


All times are GMT -4. The time now is 01:47.