Skip to main content
12 votes
Accepted

Motivation behind Collocation Method

I would not insist on demanding a geometrical meaning from Galerkin methods in general. There is a connection, but it becomes less meaningful as you extend it further and further. (In a sense, it ...
Christian Clason's user avatar
8 votes
Accepted

Don't we care about the numerical diffusion in the diffusion term?

We have the following problem: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\nu\color{blue}{\frac{\partial^2u}{\partial x^2}}=0 \tag{*}$$ The function $u$ may represent ...
HBR's user avatar
  • 1,648
7 votes
Accepted

How do I integrate a function defined over an arbitrary area?

Instead of directly integrating over the area, it is often more convenient to use the divergence theorem to replace the area integral with an integral over the boundary edges. The divergence theorem ...
Bill Greene's user avatar
  • 6,144
7 votes

Why do we have to resort to Higher order schemes for solving the 1-D advection equation/ continuity equation?

There is a difference between the requirements for a hyperbolic pde like $$ u_t + a u_x = 0 $$ and for a purely parabolic pde like $$ u_t = u_{xx} $$ Suppose the solutions are smooth and you ...
cfdlab's user avatar
  • 3,028
6 votes

What is numerical damping in the context of time-dependent FEM solvers?

It is quite straightforward to demonstrate this for implicit Euler (aka backward Euler) on a scalar example. Consider the initial value problem $$\dot{y}(t) = i \alpha y(t), \ y(0) = 1$$ with solution ...
Daniel's user avatar
  • 1,273
5 votes
Accepted

Residual norm of PDE discretization: correspondence in the continuous problem?

TLDR If you're using scalar products in FEM/FVM discretizations, use the mass-matrix scalar product, not $\ell_2.$ or If you're solving FEM/FVM systems with Krylov methods, precondition with the ...
Nico Schlömer's user avatar
5 votes
Accepted

Discretization with non-constant matrix containg entries form unknown vector

You can't. Nonlinear systems of equations are in general not solvable exactly. What you need to do is to use a method to solve nonlinear systems, of which there are of course quite a lot: A simple ...
Wolfgang Bangerth's user avatar
5 votes
Accepted

Projection method FVM poisson part, adding source term

The smooth solution turned out to have BC's applied in the following way: Walls and inlet: $\frac{\partial p}{\partial n}=0$ Outlet: $p=0$ Actually thought that we need only one value of P to pin, not ...
2Napasa's user avatar
  • 362
5 votes
Accepted

Time discretisation after splitting a 4th order equation

The introduction of $w$ is just a reformulation of your initial problem. If you use (2), this means that you make the 4th-order diffusion term explicit, which may potentially lead to stability issues. ...
Laurent90's user avatar
  • 1,943
4 votes

Finite difference discretization on a circle

The expressions you are using for eigenvalues and eigenfunctions are wrong (as per Wolfgang Bangerth's comment); therefore the results you are getting are not meaningful at all. There are analytic ...
Anton Menshov's user avatar
  • 8,692
4 votes

Is there Von Neumann stability analysis for 9-point laplacian like we have for the 5-point Laplacian?

There are actually a few different 9 point stencils in use, but they can all be written as a linear combination of the standard and skewed 5 point stencils. Performing the usual von Neumann analysis ...
origimbo's user avatar
  • 2,249
4 votes
Accepted

Flux sign and face normal confusion in finite volume method

When dealing with conservation laws like your case, you can often make use of the divergence theorem (as you did). You can then express the fact that the total mass within your integration region is ...
MPIchael's user avatar
  • 2,985
4 votes
Accepted

Dividing a continuous domain into small squares; how to perform storage and querying?

After doing some quick research, I am convinced that the interviewer was looking for an answer related to one of the data trees. Depending on the application, one might be better than the others, but ...
Abdullah Ali Sivas's user avatar
4 votes
Accepted

Can I use Q0 finite elements when there are gradients involved?

Depends on the details. If you think about the traditional $H^1$ conforming formulation with the bilinear form $(\nabla \phi, \nabla v)$ it obviously cannot work because the stiffness matrix would be ...
knl's user avatar
  • 2,104
4 votes
Accepted

constructing a symmetric matrix for finite difference

Here is an approach to achieve a symmetric finite difference operator for a space-dependent diffusion term $(r \psi_x)_x$. The trick is to apply central difference discretizations on first ...
Steven Roberts's user avatar
3 votes

Discretization Error amplification instead of stagnation to machine precision

Yes. This behavior is to be expected and normal. When you are computing with a small value for $\mathrm dx$ then, to compute the difference quotient, you are subtracting two numbers that are nearly ...
H. Rittich's user avatar
3 votes
Accepted

Problems with deriving an equation for a finite-difference scheme given in the journal paper

Initially, the equation (6) is derived from equation (4): $$ F_e\Phi_e-F_w\Phi_w=D_e(\Phi_E-\Phi_P)-D_w(\Phi_P-\Phi_W) $$ under the central differencing approximation $\Phi_e=(\Phi_P+\Phi_E)/2$, $\...
Anton Menshov's user avatar
  • 8,692
3 votes
Accepted

Discontinuous Galerkin FEM : Control points are mid-points of edges instead of nodes

For the discontinuous Galerkin method, the choice of control points is entirely unimportant because they conceptually lie in the interior of the cell (even if they are physically on the boundary of ...
Wolfgang Bangerth's user avatar
3 votes

Combining trapezoidal rule with upwind scheme

I would recommend to try a second order accurate upwind scheme. There are many of them. Let me show two of them, I use them for solving nonstationary advection equation when the solution is ...
Peter Frolkovič's user avatar
3 votes

Three steps of pde numerical solution and nonlinear equation

Linearization and discretization can be switched. The linearization then happens in function space, where a Newton method can be employed based on the Fréchet derivative of the differential operator. ...
cos_theta's user avatar
  • 451
3 votes
Accepted

Discretisation of logarithmic derivative: Deriving the formula

This should be coming from a chain rule (assuming $M$ is a function of $t$, $t_A<t_B$): $$ f(t)=\frac{d \log\big(M(t)\big)}{d \log t} = \frac{d\log\big(M(t)\big)}{dt}t=\frac{dM(t)}{dt}\frac{t}{M(t)...
Anton Menshov's user avatar
  • 8,692
3 votes

How to isolate and test time discretization order of accuracy

If you fix the spatial discretization, then you are solving a fixed system of ODEs. The exact solution of that system is not the same as the exact solution of the PDE, of course, but you can test ...
David Ketcheson's user avatar
3 votes

Stability Analysis

This is a first-order PDE but you are trying to impose Dirichlet BC on the whole boundary. This is not well-posed in general but maybe your data is such that you expect it to have a unique solution. ...
cfdlab's user avatar
  • 3,028
3 votes
Accepted

How to do Weierstrass-transform in MATLAB?

What you want is the convolution between two functions $f = |\Psi|^2$ and $g = g_{\sigma_x}(x)$, $h = (f * g)(x)$. You can compute the Fourier transform of $h$, to get $$\mathcal{F}\{h\} = \mathcal{...
nicoguaro's user avatar
  • 8,524
3 votes

Solving differential equation in Python with discretized variable coefficients

If you use diffeqpy you can use the commands adaptive=false,dt=... to specify fixed time stepping. The following is for using the Dormand-Prince RK45 method with ...
Chris Rackauckas's user avatar
3 votes

FV Discretization of source term in 2D Poisson Equation

The correct way is to average the source term which you can do easily in this case as you have a polynomial. In general you can do the average with a quadrature. For second order accuracy if the ...
cfdlab's user avatar
  • 3,028
3 votes

Tensor product representation for the 9-point finite difference approximations for the Poisson equation

This is too long for a comment, so I'll post an answer. If you start from the analytical 2D-Laplace operator, it naturally is already in a (sum of) tensor product form: $$ \Delta = \partial^2_x \...
davidhigh's user avatar
  • 3,177
3 votes
Accepted

Discretizing the viscous component in 1 - D Navier stokes compressive flow

Consider a FV method as an approximation of the integral conservation law. Starting from the one-dimensional, scalar conservation equation \begin{equation} u_t + f(u,\nabla u)_x =0, \end{equation} ...
ConvexHull's user avatar
  • 1,388
3 votes

Can I use Q0 finite elements when there are gradients involved?

There are two ways for what you are trying to do: If you approximate the gradient by finite differences involving the values at the cell midpoints, then your use of Q0 elements will lead to typical ...
Wolfgang Bangerth's user avatar
3 votes
Accepted

Non-standard boundary condition for incompressible Navier Stokes

I managed to resolve the issue, Need to compute the values only for the inner part of the domain, then apply BC for the boundary values. The only issue is that there is a backward scheme at the ...
2Napasa's user avatar
  • 362

Only top scored, non community-wiki answers of a minimum length are eligible