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

Gradients at boundary for NSCBC

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

Like Tree1Likes
  • 1 Post By cosimobianchini

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2013, 04:12
Default Gradients at boundary for NSCBC
  #1
Member
 
Felipe Alves Portela
Join Date: Dec 2012
Location: FR
Posts: 70
Rep Power: 13
fportela is on a distinguished road
Hello everyone,

I am trying to implement the characteristic boundary conditions as formulated by Poinsot and Lele.

For this, I compute the strengths of waves crossing the boundaries and adjust the boundary conditions accordingly.

In order to compute the wave strengths I need some gradients to be defined at the boundary. In the general case, these gradients have to be taken along all directions, so I am avoiding using the surface normal gradient.

Since I can't compute directly the gradients when I am updating the boundary value, I create and store (at each time step) the gradient fields (in the whole domain) that I need. I also noticed I have to update the boundary condition of the field associated with the gradient, and that this field has by default a zero gradient boundary condition.

This all works fine in 1D. However, when I move to 2D, I notice that the gradients at the boundary cells get strange values. For example, if I set up all variables as constant, the gradients will be zero in the interior points, but not at the boundary cells!

Although this value is still very small, I suspect that this is somehow affecting the performance of the b.c. (since it depends explicitly on these values).

Does any one have any idea of what is going on?

Cheers,
Felipe
Attached Images
File Type: jpg pressure.jpg (12.5 KB, 38 views)
File Type: jpg gradpressure.jpg (18.0 KB, 38 views)

Last edited by fportela; August 19, 2013 at 04:46. Reason: added images
fportela is offline   Reply With Quote

Old   August 19, 2013, 06:02
Default
  #2
Member
 
Felipe Alves Portela
Join Date: Dec 2012
Location: FR
Posts: 70
Rep Power: 13
fportela is on a distinguished road
I forgot to mention that the components of the gradient are only affected in the direction in which they are defined, i.e., gradP.x() is exactly zero at the top and bottom boundaries, but not zero at the right and left.
fportela is offline   Reply With Quote

Old   August 20, 2013, 04:35
Default
  #3
Member
 
cosimo bianchini
Join Date: Mar 2009
Location: Florence, Tuscany, Italy
Posts: 88
Rep Power: 17
cosimobianchini is on a distinguished road
Send a message via Skype™ to cosimobianchini
Hi Felipe, I did some work on NSCBC in OpenFOAM too ( paper 2012 paper 2011).
If you are interested in the simple original version of Poinsot e Lele you only need gradients normal to the boundary and the implementation should be quite straightforward starting from OpenFOAM waveTransmissive b.c. (only thing is that NSCBC are derived for density based solvers while the majority of OF solver are pressure based).
If instead you want to consider also transversal gradients, only needed in my opinion in case of largely 2D fields close to the boundary, as proposed by Lodato et al. you should look at the implementation of finiteArea discretization and apply these operators to the 2D mesh discretizing the boundary patch.
Concerning your question:
1) you should verify if this imprecision is connected to use of empty patches on the side boundary. go to 3D and verify if you have the same behaviour in the center of the domain
2) if the error remains of the same level in case of more complex variable fields, it will most likely cancel out when summed to non zero quantity. verify defining a known pressure field (i.e. linear profile)
Regards,
Cosimo
songwukong likes this.
__________________
Cosimo Bianchini

Ergon Research s.r.l.
Via Panciatichi, 92
50127 Florence - ITALY
Tel: +39 055 0763716
Mob: +39 320 9460153
e-mail: cosimo.bianchini@ergonresearch.it
URL: www.ergonresearch.it
cosimobianchini is offline   Reply With Quote

Old   August 20, 2013, 06:54
Default
  #4
Member
 
Felipe Alves Portela
Join Date: Dec 2012
Location: FR
Posts: 70
Rep Power: 13
fportela is on a distinguished road
Hi Cosimo,

Thanks for your reply

It seems like I don't have access to those papers, perhaps that's why I missed them when looking for previous work on this topic. Perhaps you could e-mail me a copy of the papers?

My (perhaps too ambitious) goal is to use these b.c. on a fully turbulent mixed super/subsonic compressible flow, in particular, I will be testing the b.c. on a supersonic channel flow, for which I already validated the solver with periodic b.c.. I also use rhoPimpleFoam for comparison, though I have found that it's performance is less than ideal for this kind of flow.

I mentioned Poinsot and Lele as it is the most known reference for non-reflecting b.c., however, I directly implemented the compatibility relations as found in the book of Hirsch. I believe this is a similar approach as that of Lodato et al. The boundary update is done on the primitive variables and the solver then handles the computation of the conservative variables (for the viscous part I have to re-write the equations to get the corresponding viscous terms in the equations for the primitive variables).

As soon as I get the inviscid case working fine, it should be straightforward to include the viscous terms (provided they are computed correctly). So my question about the accuracy of the gradients holds not only for the first stage (inviscid case) but also for the when the viscous terms are included.

Regarding your suggestions, I initialised a parallelepiped with all variables constant and saved the the gradients after one time step. It seems like the situation is unrelated to the empty patches: I attached two snapshots of the gradient for pressure (one for the magnitude and one for the x component) after one time step, the fields are all uniform. I am aware that the values are quite small, but I don't understand why they are not exactly zero (since everything is constant).

The non-reflecting conditions seem to work OK on subsonic test case (although some reflections still remain, as seen in droplet.png). I tried the supersonic vortex test case from Poinsot and Lele and I get a lot of numerical reflections (the waves actually travel upstream).

There might be something wrong with my implementation, or maybe something I missed when implementing the compatibility relations. But I would like to be sure that this thing with the gradients is not (negatively) affecting the performance of the b.c.

I also have some questions on the "viscous conditions" (their meaning and how to enforce them), but maybe we can discuss it over pm?

Cheers,
Felipe
Attached Images
File Type: jpg gradP.jpg (25.6 KB, 62 views)
File Type: jpg droplet.jpg (24.5 KB, 63 views)

Last edited by fportela; August 20, 2013 at 08:06.
fportela is offline   Reply With Quote

Old   June 29, 2021, 06:42
Default Any success
  #5
New Member
 
deewakar
Join Date: Dec 2011
Posts: 18
Rep Power: 14
alligngr8 is on a distinguished road
Quote:
Originally Posted by fportela View Post
I forgot to mention that the components of the gradient are only affected in the direction in which they are defined, i.e., gradP.x() is exactly zero at the top and bottom boundaries, but not zero at the right and left.

Hello,

Were you able to implement them in OpenFoam? Can you refer some test cases to verify this has been well implemented

Thanks
alligngr8 is offline   Reply With Quote

Old   July 1, 2021, 05:08
Default
  #6
Member
 
Felipe Alves Portela
Join Date: Dec 2012
Location: FR
Posts: 70
Rep Power: 13
fportela is on a distinguished road
Quote:
Originally Posted by alligngr8 View Post
Hello,

Were you able to implement them in OpenFoam? Can you refer some test cases to verify this has been well implemented

Thanks

This is quite an old post, unfortunately I no longer have the code with me. I suggest you have a look at the available BC's on foam-extend (e.g. the waveTransmissive might do the job).


Good luck!
fportela is offline   Reply With Quote

Old   July 1, 2021, 05:21
Default
  #7
New Member
 
deewakar
Join Date: Dec 2011
Posts: 18
Rep Power: 14
alligngr8 is on a distinguished road
I came across this presentation wherein it mentioned that waveTransmission is not effective

http://www.personal.psu.edu/dab143/O...lia_slides.pdf

Hence was wondering if some one has implemented that.

Thanks
alligngr8 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
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 05:58
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 04:05
CFX doesn't continue calculation... mactech001 CFX 6 November 15, 2009 21:25
Concentric tube heat exchanger (Air-Water) Young CFX 5 October 6, 2008 23:17
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 01:54


All times are GMT -4. The time now is 13:43.