# Questions tagged [finite-difference]

Referring to the discretization of derivatives by Finite differences, and its applications to numerical solutions of partial differential equations.

607 questions
Filter by
Sorted by
Tagged with
79 views

### FVM vs FDM vs Conservative form vs Non conservative form

My question is regarding solving the conservative form and the non-conservative form of the governing-equations (GE), like continuity or the navier stokes equation, using finite difference method (FDM)...
102 views

82 views

52 views

### Should the derivative of an array be calculated array by array or element by element in CFD codes?

I am making my own finite difference computational magnetohydrodynamic code in Fortran 90. Looking at other codes they appear to calculate for example their $x$-derivatives, bb of their variables, e.g....
73 views

82 views

### numerical instabilities in Fluid Dynamics, Finite Element Method

I'm looking for references to understand where the numerical instabilities come from in hydrodynamics in general, and notably when the Péclet number: $Pe>1$. I'm using the finite element method. ...
39 views

### Predictor-Corrector vs. Deferred Difference Corrections

I want to use the Numerov method but keep higher-order terms from the Taylor expansions. In the literature, I found the term "Deferred Difference Corrections" for the procedure of first solving the ...
132 views

### Why do many people use FDM method to solve Stokes equations, i.e., saddle point matrix?

For numerical methods of the Stokes equations, with appropriate boundary: $$-\nabla^{2} \vec{u}+\nabla p=\overrightarrow{0}$$ $$\nabla \cdot \vec{u}=0$$ one may use FDM (finite difference method) ...
85 views

### Implementing structured grid boundary conditions using NumPy arrays?

I am making a toy code in Python to solve the advection equation $$u_t + cu_x = 0$$ with, for example, periodic boundary conditions. Background information The numerical grid is specified like this: ...
85 views

### Implementation of boundary conditions for 1D Euler equations

I'm trying to solve 1D Euler equations with gravity in spherical coordinates using a finite-difference TVD MacCormack method on a non-uniform grid of $N$ components, following the method provided in ...
42 views

47 views

### WENO scheme on curvilinear coordinates

I've been developing a curvilinear FVM code. So far I've implemented the PPM scheme and am looking into adding WENO schemes. So far I've been discretizing the grid metrics using a second-order central....
108 views

### Need an example Legendre-Gauss-Radau pseudospectral differentiation matrix or Matlab code

I'm trying to implement various kinds of pseudospectral methods for direct optimization in Matlab using IPOPT. I've got some working Legendre-Gauss-Lobatto code, but would like to use the flipped ...
117 views

I am now working on solving MHD equations with finite difference method, which include nonlinear equations: $$\frac{\partial\rho}{\partial t}+\nabla\cdot\left[\left(\rho_0+\rho\right){v}\right]-\... 1answer 90 views ### What method of Finite difference is this? I am reviewing Numerical Recipes method on solving ODEs via relaxation (Chapter 18.3 in the 3rd edition) and they chose a finite difference method I am unfamiliar with (Equation 18.3.2): \begin{... 1answer 48 views ### Interpolating the gradient of a cylindrically symmetric potential field that's 'supposed to' obey the Laplace equation? The script below tries to implement a Jacobi iterative relaxation of a potential field for an electrostatic lens. It's hot-off-the-press and I've just started to debug and look for things to test it ... 0answers 31 views ### Dealing with spurious oscillations in particle tracking methods I work on modelling high intensity discharge xenon-filled lamps. The model governing the discharge is quite complex and sadly includes fluid dynamics. After some time, I managed to implement a finite-... 1answer 82 views ### Finite difference methods I am currently applying the finite difference method to the solution of the diffusion equation. I think that a problem has occurred, and is as follows, my explicit method is the most accurate when ... 0answers 39 views ### Neumann boundary conditions on arbitrary surface for finite difference diffusion I am facing the following problem, formulated in practical terms: I have a region \Omega in two or three dimensions, represented as a binary mask, and an initial density u_0 within that region ... 0answers 93 views ### Second derivative using Fornberg finite difference method I have some discrete data, non-equispaced in x, y=f(x). I want to use a numerical finite difference method to calculate the second derivatives of y, at some point. I am using the Fornberg method, ... 0answers 42 views ### How to determine the order of convergence of the Euler-Maruyama method? This question is originally posted in Quant.StackExchange but has been unanswered for some time so I ask in here. To make this simple let us consider the Geometric Brownian Motions (GBM). My ... 2answers 107 views ### Finite difference for a highly nonlinear equation - The wind within the forest Based on the Navier-Stokes equations and a few parameterizations, the horizontal steady-state wind u(z) within a forest of height H satisfies:$$ a\left(\frac{du}{dz}\right)^2 + b\frac{du}{dz} \...
Please consider the assignment I have uploaded on the picture. I am confused about the functions $g_L(t)$, $g_R(t)$ and $\eta(x)$. What are they and how do I find them... My question: Is it possbile ...