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   March 30, 2016, 13:41
Default Implementing Robin (Dirichlet+Neumann) boundary condition
  #1
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Hello
I have attached a description of the project I am working on.

I don't get my expected results, I doubt that my way of implementation of the bottom boundary condition might not be correct.
Attached Files
File Type: pdf Finite Difference-compressed.pdf (143.3 KB, 29 views)
soes is offline   Reply With Quote

Old   March 30, 2016, 16:10
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
we already discussed your problem in other posts and I still do not understand how the number of BC.s you used can close your fourth-order PDE...
Then, what about a stability analysis of your discretization?
FMDenaro is offline   Reply With Quote

Old   March 30, 2016, 17:14
Default
  #3
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Yes, I mean we have two initial conditions for time and two boundary conditions at top and bottom, and periodic boundary condition in the xi direction, that's how it closes the equation.

I did von neuman analysis and it showed that for the time steps and grid size that I am using it is stable, no worries for that, even I tried crank nicolson method it gave the same results.
soes is offline   Reply With Quote

Old   March 30, 2016, 17:27
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Accepting "per fides" that your problem is mathematically well posed, the fact that by decreasing the steps dx and dz the solution becomes wrong is possible if:

1) the dt is too large and produces a numerical instabilty. I have not checked carefully your discrete equation, since your multi-step method produces a 2x2 amplification matrix are you sure that both eigenvalues ensure a conditional stability? However, that seems not your case as you wrote that the solution is stable and dissipate the wave.

2) the discretized problem (equation + bc.s) is not consistent, that means your local truncation error does not vanish for vanishing mesh sizes.

Could you plot your numerical solutions and the analytical one at a certain time-step?
FMDenaro is offline   Reply With Quote

Old   March 30, 2016, 18:20
Default
  #5
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Here I have attached the time evolution of the solution and the exact analytical expression, as you see they perfectly mach, and the other plot shows the convergence as you can see the difference goes to almost zero 1e-6, although I should have plotted it logarithmically to show it better, but it well converges and follows that analytical solution. This is for the case without bottom corrugation.
Attached Images
File Type: jpg xyz2.jpg (70.6 KB, 7 views)
File Type: jpg xyz2converge.jpg (28.9 KB, 4 views)
soes is offline   Reply With Quote

Old   March 31, 2016, 03:13
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
1) from the plot I cannot see the shift of the wave from the position at t=0, could you superimpose the initial condition?

2) the plot is just for a value of w in one point, could you plot the global solution w(x,z)?
FMDenaro is offline   Reply With Quote

Old   March 31, 2016, 03:25
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
However, I searched in the literature but I did not find any PDE resembling that in your problem...
FMDenaro is offline   Reply With Quote

Old   March 31, 2016, 07:58
Default
  #8
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
I agree with Prof Denaro. The splitting that we discussed before assumes that you can solve a forced wave equation for phi that is defined as Laplacian(w), extract w from a Poisson equation, and then compute the next timestep driving function for the wave equation from that solution. And, this may be a favorable splitting for the boundary conditions in the initial test problem, but not for more general BCs.

There are two related and unresolved issues...characteristic/information flow directions/domains of dependence...elliptic, parabolic, etc...and well-posedness. I have no experience with equations of this sort...and your reticence to tell us about the physical system it purports to represent doesn't offer me or the others here any impetus to develop it. Quite frankly, we can write down PDEs at random that probably have very interesting and convoluted behaviors, but we have better things to think about.

Having said all of that, let me just say that you can likely get to the bottom of at least the information flow issue by building a fully implicit time discretization for w. That would entail using an implicit time integration scheme (backward Euler, Adams Moulton, or implicit RK) and apply it to the first-order split system that we outlined in previous threads. The system may be block implicit in w and dw/dt. But, this will give you a finite difference formulation that does NOT assume any directional information flow. The next timestep information will depend completely on old time and new time information. This does assume that the system is an evolution-type equation...the domain of dependence for new time lies in the old time domain and includes only THE NEXT time information...not all future time as well. That is probably a safe assumption. And this should give you results that don't rely on SPATIAL direction assumptions. If the linear system that you build is not singular or indeterminate, that (at least) gives you an indication that the system is possibly well-posed.

I will tell you that using implicit timestepping will likely introduce diffusion into the system and your waves will be damped over time. There may be energy conserving time integration schemes (especially implicit RK) that may help with this.
mprinkey is offline   Reply With Quote

Old   March 31, 2016, 12:43
Default
  #9
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road

https://drive.google.com/file/d/0B4b83ymv5MKZc3ZZWm5Qb01HY28/view?usp=sharing


@FMDenaro I have simulated the one with normal boundary conditions, and this is the video of it
soes is offline   Reply With Quote

Old   March 31, 2016, 12:51
Default
  #10
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Quote:
Originally Posted by mprinkey View Post
I agree with Prof Denaro. The splitting that we discussed before assumes that you can solve a forced wave equation for phi that is defined as Laplacian(w), extract w from a Poisson equation, and then compute the next timestep driving function for the wave equation from that solution. And, this may be a favorable splitting for the boundary conditions in the initial test problem, but not for more general BCs.

There are two related and unresolved issues...characteristic/information flow directions/domains of dependence...elliptic, parabolic, etc...and well-posedness. I have no experience with equations of this sort...and your reticence to tell us about the physical system it purports to represent doesn't offer me or the others here any impetus to develop it. Quite frankly, we can write down PDEs at random that probably have very interesting and convoluted behaviors, but we have better things to think about.

Having said all of that, let me just say that you can likely get to the bottom of at least the information flow issue by building a fully implicit time discretization for w. That would entail using an implicit time integration scheme (backward Euler, Adams Moulton, or implicit RK) and apply it to the first-order split system that we outlined in previous threads. The system may be block implicit in w and dw/dt. But, this will give you a finite difference formulation that does NOT assume any directional information flow. The next timestep information will depend completely on old time and new time information. This does assume that the system is an evolution-type equation...the domain of dependence for new time lies in the old time domain and includes only THE NEXT time information...not all future time as well. That is probably a safe assumption. And this should give you results that don't rely on SPATIAL direction assumptions. If the linear system that you build is not singular or indeterminate, that (at least) gives you an indication that the system is possibly well-posed.

I will tell you that using implicit timestepping will likely introduce diffusion into the system and your waves will be damped over time. There may be energy conserving time integration schemes (especially implicit RK) that may help with this.
@mprinkey
Thanks for the reply, if you have a look at my uploaded file on this post you see that I did not do any splitting and I solved the whole equation. Worth mentioning even with splitting, no matter in what way, the results are the same, upon similar resolutions.
I am not reticent in giving information I have mentioned all I know, all I was assigned by my course supervisor was to solve the PDE, I do not know more that what I have written.
Besides, I as well tried crank nicolson scheme, but still I had the limitation of spatial resolution, and it is weird, when I increase the spatial resolution, say more than 11 points per wave length the wave does not move at all, and gets damped away.
soes is offline   Reply With Quote

Old   March 31, 2016, 12:55
Default
  #11
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post

https://drive.google.com/file/d/0B4b83ymv5MKZc3ZZWm5Qb01HY28/view?usp=sharing


@FMDenaro I have simulated the one with normal boundary conditions, and this is the video of it

Yes, I see now, it appears nothing else that like rigid moving wave along the z direction ... it is like solving the equation dw/dt + c* dw/dz=0 at several positions along x with sinusoidal initial condition.

That increases my doubts ... can a second order in time PDE produce a single wave solution? should not be unstable (or presenting wiggles) the solution with central discretization for the case of a wave propagation?
As I wrote previously, despite my searching, I have not found nothing in literature like your PDE.
FMDenaro is offline   Reply With Quote

Old   March 31, 2016, 13:00
Default
  #12
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Yes, I see now, it appears nothing else that like rigid moving wave along the z direction ... it is like solving the equation dw/dt + c* dw/dz=0 at several positions along x with sinusoidal initial condition.

That increases my doubts ... can a second order in time PDE produce a single wave solution? should not be unstable (or presenting wiggles) the solution with central discretization for the case of a wave propagation?
As I wrote previously, despite my searching, I have not found nothing in literature like your PDE.
you mean a central difference might not be a good way of discretizing a wave like equation like this? since it cannot capture instability?
soes is offline   Reply With Quote

Old   March 31, 2016, 13:07
Default
  #13
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
you mean a central difference might not be a good way of discretizing a wave like equation like this? since it cannot capture instability?

if you work with hyperbolic equations, the solution has a domain of dependence defined by the characteristic curves, the central discretization for a first order PDE is clearly a bad choice as it violates the domain of dependence. Conversely, if you have high order PDE you can have solution with two waves coming from different regions and the central discretization could get reasonable result.

To tell the true, I suppose that could be the particular choice of your initial condition to have the form of an eigenfunction of the operators in your PDE...
FMDenaro is offline   Reply With Quote

Old   March 31, 2016, 13:15
Default
  #14
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
if you work with hyperbolic equations, the solution has a domain of dependence defined by the characteristic curves, the central discretization for a first order PDE is clearly a bad choice as it violates the domain of dependence. Conversely, if you have high order PDE you can have solution with two waves coming from different regions and the central discretization could get reasonable result.

To tell the true, I suppose that could be the particular choice of your initial condition to have the form of an eigenfunction of the operators in your PDE...
Then I will as well try with a forward and backward discretization (depending on closeness to each side) as well to see whether it fixes the problem that happens with increase in resolution.
soes is offline   Reply With Quote

Old   March 31, 2016, 13:26
Default
  #15
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
Then I will as well try with a forward and backward discretization (depending on closeness to each side) as well to see whether it fixes the problem that happens with increase in resolution.

no, this is not the issue...in case of first order hyperbolic equations, forward/backward stencils are automaticaly determined by the sign of the eigenvalues of the PDE, they are not determined by the limit of the domain.
FMDenaro is offline   Reply With Quote

Old   March 31, 2016, 13:28
Default
  #16
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
no, this is not the issue...in case of first order hyperbolic equations, forward/backward stencils are automaticaly determined by the sign of the eigenvalues of the PDE, they are not determined by the limit of the domain.
Then it comes again the issue, that my equation is not any of the conventional PDE types. Then I should probably switch to finite element method for instance
soes is offline   Reply With Quote

Old   March 31, 2016, 13:32
Default
  #17
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Soheil.esmaeilzadeh View Post
Then it comes again the issue, that my equation is not any of the conventional PDE types. Then I should probably switch to finite element method for instance
no, finite element is just a different way to discretize the PDE, does not change the original nature of your PDE... what is more, the FE require to produce a suitable functional form of your PDE with proper shape function (in space). And the time integration is often nothing else that a FD discretization.
FMDenaro is offline   Reply With Quote

Old   March 31, 2016, 13:36
Default
  #18
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
no, finite element is just a different way to discretize the PDE, does not change the original nature of your PDE... what is more, the FE require to produce a suitable functional form of your PDE with proper shape function (in space). And the time integration is often nothing else that a FD discretization.
But a colleague has successfully with high resolution with finite element method has solved this PDE with no such issues that I have, and he has not examined the stability or has not found out the PDE type and etc, just has discretized and solved it.
soes is offline   Reply With Quote

Old   April 1, 2016, 20:50
Default
  #19
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
The formulation in the pdf at the top of this thread is NOT implicit in time even though you are solving a linear system for the new time values of w. You used central differencing of the d^2/dt^2 operator, so the new time value is known explicitly by solving for phi_n+1 = laplacian(w_n+1). The fact that you have implicitly discretized the spatial operator and built a linear system does not make this an implicit time stepping scheme. So, this assumes some information flow in the system, just like the earlier splitting approach did.

My recommendations from before stand. Adams Moulton, backward Euler, or Implicit RK for the time advancement.
mprinkey is offline   Reply With Quote

Old   April 2, 2016, 12:46
Default
  #20
Member
 
Soyol
Join Date: Jun 2014
Location: Berkeley, CA
Posts: 39
Rep Power: 11
soes is on a distinguished road
Quote:
Originally Posted by mprinkey View Post
The formulation in the pdf at the top of this thread is NOT implicit in time even though you are solving a linear system for the new time values of w. You used central differencing of the d^2/dt^2 operator, so the new time value is known explicitly by solving for phi_n+1 = laplacian(w_n+1). The fact that you have implicitly discretized the spatial operator and built a linear system does not make this an implicit time stepping scheme. So, this assumes some information flow in the system, just like the earlier splitting approach did.

My recommendations from before stand. Adams Moulton, backward Euler, or Implicit RK for the time advancement.
Yes in the pdf there is an explicit scheme, but I have also tried crank nicolson, but it had a similar behavior, limitations and problems described above.
soes 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 05:09
Implementing boundary condition as additional term in differential equations MdoNascimento OpenFOAM Programming & Development 1 March 25, 2015 11:48
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Dirichlet boundary condition for additional variable on the wall ftab CFX 13 January 27, 2013 12:24
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


All times are GMT -4. The time now is 21:25.