Share Your Experience: Take the 2024 Developer Survey

# Tag Info

### What programming language should I choose and why?

You should definitely check out Julia. Julia is a programming language which is similar to Python or MATLAB but utilizes a strong type-inference algorithm + JIT in order to optimize code. If types can ...
• 12.3k
Accepted

### Without positive definiteness, does an iterative solver work?

No, positive definiteness (and symmetry) are only precondition to using the Conjugate Gradient method. But there are plenty of other iterative methods such as MinRes and GMRES that can be used for ...
• 55.7k

### What programming language should I choose and why?

What is it you want to achieve? If you want to develop methods/algorithms you might prefer a language that is flexible, and that you are familiar with. As you stated in your question, the Fortran ...
• 559

### What programming language should I choose and why?

Start simple. Learn Python. I have been paid to write programms for over forty years and I have used all the languages mentioned in other answers (except Julia - I had never heard of it before now). ...
• 211

### Why FVM can handle unstructured meshes while FDM cannot?

The difference between finite volumes and finite differences is really more about the form of the equations solved. In typical FV methods, the conservative form is ...

### What are the conceptual differences between the finite element and finite volume method?

The basic difference is simply the meaning to be attached to the results. FDM predicts point values of any aspect of the solution. Interpolation between these values is often left to the imagination ...
• 1,154
Accepted

### Why is the FVM traditionally used in CFD, and FEM in computational structures?

The finite element method is actually quite widely used in fluid flow problems, for example for the Stokes and Navier-Stokes equations. The delineation between the methods is more along the following ...
• 55.7k
Accepted

### CFL condition in Discontinuous Galerkin schemes

The restrictive CFL of DG schemes typically comes from the combination of high order accuracy and a compact stencil (see this reference for example). The CFL depends on bounding the variational form ...
• 3,142

### Finite Difference and Finite Volume as special cases of Finite Element

A good example is if you use bilinear finite elements for the Laplace equation on a uniform mesh, and then approximate the integrals using the trapezoidal rule, then you get the usual 3-point stencil (...
• 55.7k
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 ...
• 1,648
Accepted

### Is mesh orthogonality important for FEM?

Yes. The constants that appear in the interpolation estimates upon which finite element error estimates are based contain minimum and maximum angles of triangles/tetrahedra (or similar geometric ...
• 55.7k
Accepted

### Why is the continuous Galerkin Finite Element Method a poor choice for the inverse problem for the Navier-Lame equation?

The issue with finite elements in the current context is not that you have a first order differential equation, but with the kind of first order equation you have. In general, finite element methods ...
• 55.7k

### What programming language should I choose and why?

I highly recommend to anyone, regardless of background, learning both low-level, "fast" language (C, Rust, C++, Go) high-level scripting language (Python, MATLAB, Mathematica, R, bash) As a general ...
• 161

### What programming language should I choose and why?

You have some great answers already. I think there is no single answer to your question. What language(s) you choose to learn depends on what you intend to do. When I was a graduate student I too ...
• 161
Accepted

### Spectral methods, Spectral Volume methods, Spectral Difference methods

"Spectral methods" usually means methods which make use of global basis functions. Fourier spectral methods use sine and cosine, and are used when you have periodic boundary conditions. Chebyshev ...
• 3,028
Accepted

### How to correctly define the flux in a finite volume method for Poisson's equation with a piecewise constant material

Taking the average will certainly work, but is recommended to take the harmonic mean to account for the changing conductivity: $k = \Big( \frac{1-f}{k_i} + \frac{f}{k_{i+1}} \Big)^{-1}$ If you ...
• 128
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 ...
• 55.7k

### How to compute turbulent energy cascade

Of course, the Fourier transform is a linear operator. So, you have the kinetic energy defined as: $E(\mathbf{r}) = \frac{1}{2} \mathbf{u}(\mathbf{r}) \cdot \mathbf{u}(\mathbf{r})$. The Fourier ...

### What programming language should I choose and why?

Given what you've said, I would learn C++. For one, it allows you to use MPI and lots of libraries for FEM, such as Deal.ii (which all members of this forum are obligated to mention as per our ...
• 2,089
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 ...
• 362
Accepted

### Burger's equation (PDE) does not work with downwind difference?

The qualitative difference between upwind and downwind flux (note that both are first order accurate for twice continuously differentiable solutions) lies in the fact that the upwind flux (in the ...
• 1,083
Accepted

### Initial Condition in a Numerical Problem

That depends on the equation you have, and on the situation you want to model. Imagine, for example, that you are considering the advection equation $$\partial_t u + c \partial_x u = 0,$$ i.e., ...
• 55.7k

### Finite Difference and Finite Volume as special cases of Finite Element

I can't speak much for FV, never having worked much with the technique. But many FD methods can be rewritten as an FE method that judiciously chooses basis sets and quadrature rules in such a way that ...
• 4,906

### Finite volume software packages

Have a look at Pyclaw. This library has been around for quite a while and is fairly robust. It offers: Implementations of several Godunov-type methods and Riemann solvers in 1/2/3D. Adaptive mesh ...
• 2,216
Accepted

### Does the PDE hold at every cell in a FVM mesh?

As with many questions that are more about philosophy than science, there are at least three different ways of answering your question, each with a fairly solid argument: Given that the finite volume ...
• 2,249
Accepted

### Grid dependence of a numerical model

Your numerical solution is probably just getting more accurate as you increase the number of grid points. Do you know or have you tried to derive the analytic (exact) solution for this problem? By ...
• 343
Accepted

### Is there any fundamental difference between meshing for FEM, FVM and FDM?

You are correct that FDM requires structured meshes, so you are restricted to those. On the other hand FEM and FVM can both do structured meshes as well as unstructured meshes depending on the ...
• 489

### Computing face fluxes in FVM

You are looking for a harmonic average. If you think about the face between two cells, what kind of peculiar cases can happen? If your material properties are equal, you want the flux to represent ...
• 2,935
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 ...
• 2,935