CFD Online Logo CFD Online URL
Home > Forums > 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

LinkBack Thread Tools Display Modes
Old   August 19, 2013, 04:12
Default Gradients at boundary for NSCBC
Felipe Portela
Join Date: Dec 2012
Location: London
Posts: 64
Rep Power: 7
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?

Attached Images
File Type: jpg pressure.jpg (12.5 KB, 24 views)
File Type: jpg gradpressure.jpg (18.0 KB, 23 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
Felipe Portela
Join Date: Dec 2012
Location: London
Posts: 64
Rep Power: 7
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
cosimo bianchini
Join Date: Mar 2009
Location: Florence, Tuscany, Italy
Posts: 88
Rep Power: 10
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)
songwukong likes this.
Cosimo Bianchini

Ergon Research s.r.l.
Via Panciatichi, 92
50127 Florence - ITALY
Tel: +39 055 0763716
Mob: +39 320 9460153
cosimobianchini is offline   Reply With Quote

Old   August 20, 2013, 06:54
Felipe Portela
Join Date: Dec 2012
Location: London
Posts: 64
Rep Power: 7
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?

Attached Images
File Type: jpg gradP.jpg (25.6 KB, 37 views)
File Type: jpg droplet.jpg (24.5 KB, 37 views)

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


Thread Tools
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 On
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 05:05
CFX doesn't continue calculation... mactech001 CFX 6 November 15, 2009 22: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 02:54

All times are GMT -4. The time now is 20:49.