Science topic

# Finite-Difference Schemes - Science topic

Explore the latest questions and answers in Finite-Difference Schemes, and find Finite-Difference Schemes experts.
Questions related to Finite-Difference Schemes
• asked a question related to Finite-Difference Schemes
Question
Staggered grid finite-difference (FD) methods are widely used for elastic wave equation modelling because of their high computational efficiency, smaller memory requirement and easy implementation. I am looking for the mathematical foundation for higher order (8th) of finite difference staggered-grid method on 2D P-SV elastic wave propagation.
Dear Dr.
Ijaz Durrani
,
• asked a question related to Finite-Difference Schemes
Question
Dear all,
I am trying to couple a simulation with two codes, say code A and code B (different discretizations). For code A we solve simply the conduction equation (solid), while in B we solve the NS + temperature convection/diffusion (fluid).
The coupling is explicit, while the time scheme for each code is implicit.
at each iteration, code A gives code B the heat flux to impose at the boundary of domain B, while code B gives code A the temperature to impose at the boundary of domain A. So in short, the coupling is done via a Neumann/Dirichlet BCs.
I am facing stability issues that don't allow me to finish correctly the transient solution.
Let us focus only on domain A (code A). When code A receives the temperature values from code B to apply a Dirichlet BC, the values are stocked in a layer of cells; so called the ghost cells. We denote these values as T_wall.
Now, we need to compute the heat flux at the boundary to give to code B. There are two possibilities to compute such a flux :
1- use T_wall and one inner temperature value
2- use 2 or 3 inner temperature values to calculate the flux, and then extrapolate it to the boundary.
I am getting serious instabilities if I calculate the flux via the first approach (T_wall and 1 inner temperature value). Otherwise, with the second approach (only inner temperature values), the simulation is stable and a steady-state is reached.
Can I have please your opinion on this subject. Have you ever faced such kind of problems ?
Is it really true that computing the flux with the second approach leads to a stable solution, but to a non-consevative scheme ?
Best regards
Elie Saikali
The stability condition is Fo Bi < 1 (CAST3M club presentation in 2019 at the CAST3M website by myself)... and serious references on the question :
Giles, M. B. "Stability analysis of numerical interface conditions in fluid–structure thermal analysis." International journal for numerical methods in fluids 25.4 (1997): 421-436.
Errera, Marc Paul, and Florent Duchaine, 2015. "STABLE AND FAST NUMERICAL SCHEMES FOR CONJUGATE HEAT TRANSFER."
• asked a question related to Finite-Difference Schemes
Question
I am solving a transinet convection-diffusion equation
u_t + a*u_x - nu*u_xx = 0 in (0,1)
Taking,
Convection coefficient a = 1
Diffusion coefficient nu = 0.005
Number of elements = 100
I got Peclet number Pe = 1
For same case now,
Time step = 0.01
End time = 0.6
I got Courant number C = 1
I need following 4 conditions to fulfill.
1). C =1 and Pe = 5
2). C =1 and Pe = 100
3). C =3 and Pe = 5
4). C =3 and Pe = 100
My question is:
What should be the value of
"Convection coefficient a",
"Number of elements",
"Diffusion coefficient nu",
"Time step" and
"End time"
to get these 4 results separately.
Peclet number relates mainly to spatial discretization, while Courant number to temporal discretization.
Courant number: The Courant number is deﬁned as Cr= epsilon Dt/h
Diffusion number: The diffusion number is deﬁned as S=gama Dt/(h*h)
Grid Péclet number: The Péclet number is deﬁned as Pe = Cr/S .
They are used in Advection Diffusion Equation.When the Péclet number is high, the convection term dominates and when the Péclet number is low the diffusion term.
The Courant number reflects the importance of the convection process, the grid Peclet and Courant numbers can be respectively defined as t 1 do Pe(h) = BA. The values of these parameters are generally higher for coarser materials. For 3D transport models, the main problem is the large CPU time demand because all known finite difference and finite element algorithms have to take into account the grid Peclet number and Courant number limits.
Co = J^ _ < (0.5... 1) Limit up to 1
Ashish
• asked a question related to Finite-Difference Schemes
Question
To solve the heat conduction (or diffusion) equation, it is well known that explicit schemes (like FTCS) are rarely used, because very tiny timesteps are required to avoid instability. I know that implicit methods usually have no such problem, but they have to handle huge matrices and cannot be trivially parallelized.
However, there are explicit methods with much better stability properties:
- Runge–Kutta–Chebyshev,
- Hopscotch,
- Dufort-Frankel (etc.?)
Now I can not really understand why they haven't become widespread in the practice. Have they got serious disadvantages? If yes, what are them? Or maybe only because people are unaware of them?
The question is why explicit schemes are not used and then you cite
- R K Chebychev method
- Hopscotch
- Dufort-Frankel scheme
There are three properties must be discussed about a scheme which are consistency, convergence and stability. If a scheme is consistent then stability implies convergence.
Let us considered du Fort - Frankel scheme, it is three level scheme which is unconditionally stable but not consistent unless time step k is smaller than space step h (k must tend to zero faster than h,i.e. k<<h)
ADE method is for two dimension problems and has worse stability conditions.I think you are talking about AGE , Alternating Group Explicit Schemes, which are better but computation time is more.
R K Chebychev method is to solve a system of ODE. But it is conditionally stable.
Hopscotch schemes again one must choose h so that scheme is consistent.
• asked a question related to Finite-Difference Schemes
Question
In Convective heat transfer phenomena
to obtain a constant temperature condition, using condensation or evaporation seems the best way. For constant heat flux condition, use of electric heaters is the best way in a laboratory.
• asked a question related to Finite-Difference Schemes
Question
I have the following problem:
u_t = u_xx + u_yy, in Omega, t > 0
u(x,y,0) = 1, in Omega
u(x,y,t) = 0, on dOmega, t > 0
when Omega is defined to be a domain between the rectangular 1x1 and the circle of radius 0.3 centered at (0.5,0.5). dOmega denotes the boundary of the domain Omega.
I want to solve the problem numerically using explicit scheme for dx = dy = 1/50. And I want to solve it in MATLAB.
So far i got a general scheme for all the points, the problematic and non-problematic ones. But I don't know how to compute it.
I want some code that can, for each point, detect the value of alpha and beta (the coefficients in front of dx, dy when the distance to a neighboring grid point is less than dx or dy, i.e. when the neighboring grid point is on the boundary of the circle), for every point on the grid.
Can anyone help me figure out how to compute this?
there are several methods ( using finite difference method) to deal with, for example, crank-Nicolson method , ADI approach
• asked a question related to Finite-Difference Schemes
Question
I am solving a parabolic PDE with compact finite difference schemes and I don't have the exact solution for that. So how can I obtain the spatial order of convergence and temporal order of convergence separately for the above PDE because double mesh principle gives the global order of convergence (to the best of my knowledge).
As others have suggested, if the accuracy of your scheme in time is known, then you can adjust the time step so that the error of the time scheme will be smaller than that of the spatial scheme - for example, if you have a 2nd order scheme in time but a 4th order scheme in space, then the time step should be at least as small as dt = O(dx^2) - this way, the error of the time scheme is O(dt^2) = O(dx^4), and the resulting global convergence rate will allow you to determine the spatial accuracy up to O(dx^4).
Your question about not having an exact solution to compare with has not yet been addressed. The general idea is to compare your numerically obtained solutions on successively finer grids. The simplest case one can imagine is a finite difference problem with equally spaced Cartesian nodes. In this case, say you use a grid with 16 nodes in each spatial direction for your first computation and a grid with 32 nodes in each spatial direction for the second. You will need to be careful that the 32-node grid coincides with the 16-node grid at those 16 nodes, and then you can compute the error between the two numerical solutions at those 16 nodes. In order to get a convergence rate, you will have to take one more refinement - now do the same with 64 nodes in each spatial direction (which again coincides with the previous grids), and compare the numerical solutions on the 32-node grid. From the ratio of the 16-32 error and the 32-64 error, you can get a measure of the convergence - you will probably want to continue this process for another step or two.
It is also critical that the times that you are comparing at coincide - you may either choose some final time to end all simulations regardless of the space/time steps, or else you may do something similar to the above spatial grid in time and compare the solutions at several different time steps on successive grids, making sure that your time grids coincide as you refine.
• asked a question related to Finite-Difference Schemes
Question
I am trying to implement Maccormack finite-difference scheme (1969) to find the solution of HD (/MHD) equations in spherical polar coordinate. For simplicity axisymmetric condition can be assumed. The main problem is arising from the continuity equation : $\frac{\partial \rho}{\partial t} = \nabla (\rightoverarrow{v} \rho)$.
The divergence operator contains both the derivatives with respect to "r" and "\theta". I have some confusions how to implement the forward and backward difference with respect to "r" and "\theta" for predictor and corrector steps.
Is there any proper reference for this particular 2d/3d problem?
The backward and forward approximations should be introduced for each coordinate
independently. However, the MacCormack method may not be the optimal choice. More modern  high resolution algorithms are found e.g. in the paper by R.Leveque
• asked a question related to Finite-Difference Schemes
Question
Anybody can explain why WENO scheme is not considered to be TVD.
Is there any implication of this fact on reconstruction data having large gradients ?
What about MPWENO, is this method abstain the emergence of oscillation in the vicinity of large gradients when using WENO?
As Tomasz mentioned WENO is not TVD by design since the high order polynomial interpolation will always lead to (hopefully small) overshooting near discontinuities. Please note however that WENO schemes are often combined with Runge-Kutta schemes which are TVD in the ODE sense.
• asked a question related to Finite-Difference Schemes
Question
Hi,
I want to implement WENO reconstruction on characteristic variables.
Therefore, the following transformation between primitve and characteristic variables has to be defined:
W= P-1 V
where W is the characteristic variable vector,
V is the primitive variable vector
and P is the Jacobian matrix.
In the literature I saw it is common to write the above transformation as follows:
Wi= (Pi+1/2)-1 Vi
Pi+1/2  is to be evaluated at Vi+1/2 through arithmetic or Roe's average.
For this example, we choose fifth-order spatial accurate reconstruction and therefore the three stencils are being used:
S0=(i,i+1,i+2), S1=(i-1,i,i+1),S2=(i-2,i-1,i)
Then, one has to apply WENO reconstruction on Wi (characteristic vector) with the stencils indicated above and to get
WL,i+1/2  and WR,i-1/2  .
I encountered some difficulties in doing so and I got oscillations in the vicinity of discontinuities.
1. Why the projection matrix is "freezed" at Vi+1/2 ? Wht not just Vi
2. Wwas calculated throught Pi+1/2, and then being used to reconstruct WR,i-1/2.  Isn't it wrong to use state variables data from the right neighnour in order to reconstruct the left side of a given computational cell?
3. In the matrix P there are terms involving the speed of sound c. How should this speed be calculated? The first option is to calculate the speed at each cell and average as: ci+1/2 = 0.5(ci+ci+1). The second option is to calculate c at the cell face with the use of the primitive variables at the cell face,although then one has to average e.o.s parameters at the cell face as well.
4. Is there any simple numerical code (FORTRAN,C,MATLAB) that one can learn the use of characteristic WENO reconstruction ?
It is best to carry out procedure in characteristic variables. The reasons are explained in e.g. 1987  ENO paper by Harten et al As to why i+1/2, not i, - because it has to be symmetric.
• asked a question related to Finite-Difference Schemes
Question
thanks for your time and responding...
I have some questions..
Does  Fourier transform need a code in this software(lumerical)? what does this monitor mean (frequancy domain field and power )? what does it measure?
I excite the antenna with a plane wave by pure frequency...when we reach steady-state? with which monitor I can record the field amplitude and phase at each point?
how can I excite with an impulse, record the impulse response, and Fourier transform the impulse response?
thanks very very very much....
• asked a question related to Finite-Difference Schemes
Question
ENO is a much better class of accurate scheme
Implementation is well reported in Shu-Osher Harten report from ICASE 1990
I have used both ENO and WENO (and CENO) on multidimensional hydrodynamic problems.  Prior to describing the merits of the ENO and WENO methods, it is important to understand some history.
First, if one uses a high-order method (not ENO or WENO) near discontinuities (i.e. step function) then extreme oscillations will occur.  These oscillations can grow unacceptably large as the mesh is refined which prevents convergence.  Godunov mathematically proved that the only numerical schemes that guarantee no overshoots or oscillations are first order accurate. Here is the challenge, how does one do better than first-order accurate (i.e. piecewise constant)?
Van Leer proposed a hybrid approach.  The idea is to switch from a second-order accurate method to a first-order method near discontinuities.  This switching processing is called limiting the polynomial reconstruction of the field; in other words, smoothly switch from using a linear polynomial to using a piecewise constant approximation.  Look for papers on the MUSCL approach for more information.  One can also use quadratic polynomials and then limit the polynomial reconstructions near discontinuities.  The limiting approach is very robust, produces smooth solutions, and is widely used on problems with shocks and other discontinuities.  The weakness is that the limiting process produces first-order accurate solutions near discontinuities.
The ENO and WENO methods allow robust solutions and permit higher-order solutions at discontinuities.  These methods relax the requirement of no overshoots or oscillations near a discontinuity.  The objective with ENO and WENO is to reconstruct the field with a high-order polynomial that produces minimal oscillations near a discontinuity, hence the names: essentially non-oscillatory (ENO) and weighted essentially non-oscillatory (WENO).  The high-order polynomial in the ENO approach is chosen to be the smoothest high-order polynomial out of a set of possible candidates.  These candidate polynomials are built from using the information in neighboring cells and beyond (can be more than 5 cells away).  For WENO, weights are placed on each candidate polynomial based on the smoothness and to maximize the accuracy of the solution in smooth regions.  The essentially non-oscillatory methods are very powerful and they work very well on a wide range of problems.  I highly recommend these methods.  They can be applied to unstructured meshes in 3D, although it requires some work.
• asked a question related to Finite-Difference Schemes
Question
I want to calculate order of accuracy of Finite Difference Scheme with non-uniform grids. Here analytical solution is not available. Please suggest some idea..
To have some idea whether the finite scheme is working fine or not choose grid points N, 2N and 4N. Assume solutions for 4N points as accurate, compute Max. Absolute Errors in N and 2N grid points.Find order of accuracy from here by using formula       log( E/ E2N) / log(2).
• asked a question related to Finite-Difference Schemes
Question
I have problem with specifying blending factor 0.9 where can I specify this blending factor in FLUENT
High oreder schemes in CFX and fluent  is robust and have less accuracy when using a specific blend of 1. It varies with different simulations
• asked a question related to Finite-Difference Schemes
Question
Does anybody know how the derivatives of the coefficient functions in equation (4) of the paper "High-Order Difference Schemes for Two-Dimensional Elliptic Equations" by M. M. Gupta, R. P. Manohar and J. W. Stephenson are discretised? Assuming that the nine-point stencil should be kept, second-order central differences are a "natural" choice, I assume. But how can this lead to a fourth-order accurate scheme?
The wikipedia article on Numerov's method shows the derivation in one dimension, http://en.wikipedia.org/wiki/Numerov's_method , and from that you can get an ide of how the stencil is constructed in two or more dimensions.
• asked a question related to Finite-Difference Schemes
Question
I try to solve numerically the differential equation with mixed derivative. I found one possibility for the mixed derivative like y(i+1,j-1)-y(i,j-1)-y(i-1,j+1)+y(i-1,j). But may be there are another ways...
(uxy)ij  =[ (uy)i+1,j - (uy)i - 1,j ] / (2hx)
= [ ( ui+1,j+1 - ui+1, j -1)/ (2hy)  - ( ui-1,j+1 - ui-1, j-1)/ (2hy) ] /(2hx)
=( ui+1,j+1 - ui+1, j -1 -  ui-1,j+1 + ui-1, j-1)/ (2hy)(2hx)
• asked a question related to Finite-Difference Schemes
Question
Which dimensionless numbers should be taken into account in the stability analysis of a numerical method for Unsteady Convection-Diffusion Problems?
In FEM, solving Convection-Diffusion problem is tricky for high peclet number. But for stability, using explicit time integration courant number should be less than 1. For implicit solvers, it may be large. But if you have high peclet number, it's always difficult.
• asked a question related to Finite-Difference Schemes
Question
Which one shows more stability and accuracy of the numerical solutions?
1). Lax-Wendroff method with consistent mass matrix
2). Lax-Wendroff method with diagonal mass matrix
I want to know in General for each case.
• asked a question related to Finite-Difference Schemes
Question
To approximate numerically the solution U we consider the Galerkin space discretization and time discretizations based on the Crank-Nicolson method and on the fourth-order Padé approximation R2,2.
What are the steps required to compute the approximate solution Un+1 at the time level tn+1 using both these discretization schemes?
Hi Ghaffar! Once you have descritized and your numerical scheme is obtained. I suppose you have a two level scheme. Taking initial condition as Un , compute your rhs. Apply boundary conditions to obtain a system of equations whose size depends on the points taken along space direction. This system will be linear if given PDE is linear else it is non-linear. Solve it to obtain solution Un+1.
Now Un+1 is obtained , transfer it to Un and get solution at new time step 2Dt as explained above.
• asked a question related to Finite-Difference Schemes
Question