CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Implementing Robin (Dirichlet+Neumann) boundary condition

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2016, 16:49
Default
  #21
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
Here is the source of these equations. See Appendix A.

http://arxiv.org/pdf/1604.07308v1.pdf

I had to find you at Berkeley and then find your advisor. You could have made this a lot easier for us if you told us this was some shallow wave model and gave us something to go on. I will look at this again, as you asked.
mprinkey is offline   Reply With Quote

Old   April 27, 2016, 00:06
Default
  #22
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
You said that the waves are damped, even in the flat bottom case as you resolve the spatial grid. Are you reducing the timestep proportionally? Also, are you solving the linear system to high tolerance?

The goal of the second problem seems to be the construction of the wave solution with a corrugated seabed. So rather than w = 0 at z = 0, it needs to be w = 0 at z = A sin(k x) where A is small compared to the water height. I don't see the value in trying to impose some complicated boundary condition while keeping z = 0. It is certainly possible and would be the direction one might take if pursuing an analytical or perturbation solution, but it discards one of the most important features of computational methods--the ability to have variable spaced grids/control volumes/elements. So, I will offer three approaches that should all work for the problem as defined. These are enumerated from EASY to HARD. Here is a visual aid for the first two approaches. The third, I mention only for the sake of completeness:

http://aeolustec.com/download/4thOrderWave.pdf

(1) Do a Cartesian-type grid that intersects the corrugated seabed by making the first line of points in the z direction have a z-coordinate = A sin(k x). The w value at that boundary is still set at 0. The 2nd derivative in the z-direction will need to be adjusted for the first computed row of values where z = dz because there will be two different delta values. The distance from that row to the seabed will NOT necessarily be dz. The formula for d^2/dz^2 will need to be replaced in all locations with this:

https://mathformeremortals.wordpress...-three-points/

This is fairly EASY to implement starting with what you have already done. It is really just modifying the z-derivatives formulae. This implementation will only be correct if the amplitude of the seabed corrugation is less than the scale of dz. Maybe A < 0.3 dz.

(2) Proper coordinate transformation of the corrugated seabed domain. The transformation would look like:

x' = x
z' = (z - A sin(k x)/(1 - A sin(k x))

So, at z' = 0, z = A sin(k x) and the other boundary conditions locations and values remain the same and you can discretize the x',z' system using constant values of dx' and dz'.. But the coordinate transformation does require substantial modification to the governing equations because the coordinate lines are no longer straight lines and orthogonal. See Equation 39 in this paper:

http://www.csun.edu/~lcaretto/me692/...formations.pdf

to see how to write the Laplacian in the transformed domain. This is an difficult process because it requires analytical differentiation and much more code to get right, but this is a typical structured-grid approach from finite difference codes of days gone by. This does have the merits of being valid for any reasonable choice of corrugation height. This is MODERATELY difficult to implement.

(3) Unstructured finite volume formulation...this is likely the enabling fact that allowed your colleague to succeed with finite elements. The seabed it meshed with unstructured finite volumes in much the same way one might for finite elements. The transport equations then are built by integrating over each control volume...it will lead to a lot of complicated and potentially critical non-orthogonal gradient computations at the faces to do those surface integrals. If you want to pursue this approach, you are likely better off starting with OpenFOAM and build on their meshing and unstructured formulation. Starting from scratch here will be HARD.
mprinkey is offline   Reply With Quote

Old   April 27, 2016, 00:53
Default
  #23
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Thank you for the reply.

I will proceed with your first solution probably, which seems more straightforward than the others. Yes the other guys have done this with finite element method using unstructured grid at the bottom, seems that the finite difference scheme cannot handle this type of PDE quite well, and has limitations.

But, I got to know that the one even without corrugation, only runs for specific time step and resolution.
I decreased time step for instance, and decreased the grid spacing proportionally, but it did not work and soon got damped away. (proportional in the CFL sense)

The optimum value for grid resolution came out 11 points per wavelength (a peak and trough) of the initial wave, that I use from the analytical expression as initial condition.
Suppose I initialize with a wave with 2 peaks and troughs in both x and z direction with 22 points only in x and z direction. It works fine and waves move for long run without any damping, and solution converges fast and follows theoretical expression.
But if with the same resolution and time step and domain, I just make the initial wave, one with 1 peak and trough, wave never moves, and gets damped away soon, with this case even if I make the time step half it does not move again and damps away. Only if I change number of points to 11 it works fine again.

It is so weird how it behaves, and I have no idea for that. So that's why I never moved forward for corrugated bottom.

Thank you for your time.


Quote:
Originally Posted by mprinkey View Post
You said that the waves are damped, even in the flat bottom case as you resolve the spatial grid. Are you reducing the timestep proportionally? Also, are you solving the linear system to high tolerance?

The goal of the second problem seems to be the construction of the wave solution with a corrugated seabed. So rather than w = 0 at z = 0, it needs to be w = 0 at z = A sin(k x) where A is small compared to the water height. I don't see the value in trying to impose some complicated boundary condition while keeping z = 0. It is certainly possible and would be the direction one might take if pursuing an analytical or perturbation solution, but it discards one of the most important features of computational methods--the ability to have variable spaced grids/control volumes/elements. So, I will offer three approaches that should all work for the problem as defined. These are enumerated from EASY to HARD. Here is a visual aid for the first two approaches. The third, I mention only for the sake of completeness:

http://aeolustec.com/download/4thOrderWave.pdf

(1) Do a Cartesian-type grid that intersects the corrugated seabed by making the first line of points in the z direction have a z-coordinate = A sin(k x). The w value at that boundary is still set at 0. The 2nd derivative in the z-direction will need to be adjusted for the first computed row of values where z = dz because there will be two different delta values. The distance from that row to the seabed will NOT necessarily be dz. The formula for d^2/dz^2 will need to be replaced in all locations with this:

https://mathformeremortals.wordpress...-three-points/

This is fairly EASY to implement starting with what you have already done. It is really just modifying the z-derivatives formulae. This implementation will only be correct if the amplitude of the seabed corrugation is less than the scale of dz. Maybe A < 0.3 dz.

(2) Proper coordinate transformation of the corrugated seabed domain. The transformation would look like:

x' = x
z' = (z - A sin(k x)/(1 - A sin(k x))

So, at z' = 0, z = A sin(k x) and the other boundary conditions locations and values remain the same and you can discretize the x',z' system using constant values of dx' and dz'.. But the coordinate transformation does require substantial modification to the governing equations because the coordinate lines are no longer straight lines and orthogonal. See Equation 39 in this paper:

http://www.csun.edu/~lcaretto/me692/...formations.pdf

to see how to write the Laplacian in the transformed domain. This is an difficult process because it requires analytical differentiation and much more code to get right, but this is a typical structured-grid approach from finite difference codes of days gone by. This does have the merits of being valid for any reasonable choice of corrugation height. This is MODERATELY difficult to implement.

(3) Unstructured finite volume formulation...this is likely the enabling fact that allowed your colleague to succeed with finite elements. The seabed it meshed with unstructured finite volumes in much the same way one might for finite elements. The transport equations then are built by integrating over each control volume...it will lead to a lot of complicated and potentially critical non-orthogonal gradient computations at the faces to do those surface integrals. If you want to pursue this approach, you are likely better off starting with OpenFOAM and build on their meshing and unstructured formulation. Starting from scratch here will be HARD.
soes is offline   Reply With Quote

Old   April 27, 2016, 04:34
Default
  #24
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Just some ideas according to the Michael's comments

1) Owing to the linearized model, the BC.s can be set at z=0 providing a perturbation velocity along the plane. That is quite common for linearized problem base on small pertubation. Thus, FD are quite simple to be used.

2) The 4th order PDE comes from a standard hyperbolic system. I suppose it should somehow respect the mathematical constraint for hyperbolic problems in term of BC.s

3) the solution cannot be optimal only on a grid... It looks like when the 1D linear wave equation is solved using the Courant number equal to 1 and produces the exact solution for those time and grid steps. But this is just a particular case...
FMDenaro is offline   Reply With Quote

Old   April 27, 2016, 07:56
Default
  #25
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
P.S.: sorry to say that from the reading of Appendix A I still have trouble understanding what is done... The procedure starts from the Euler equation (2.1a) that is a balance of accelerations ([v]/[t]), then (after linearization) that produces an equation for the balance of terms dimensionally equivalent to [v]/([t][L])^2.
That is not clear to me at all...
FMDenaro 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
several fields modified by single boundary condition schröder OpenFOAM Programming & Development 3 April 21, 2015 06:09
Implementing boundary condition as additional term in differential equations MdoNascimento OpenFOAM Programming & Development 1 March 25, 2015 12:48
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
Dirichlet boundary condition for additional variable on the wall ftab CFX 13 January 27, 2013 13:24
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 03:27.