Skip to main content
Share Your Experience: Take the 2024 Developer Survey
21 votes

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 ...
Chris Rackauckas's user avatar
12 votes
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 ...
Wolfgang Bangerth's user avatar
11 votes

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 ...
Dohn Joe's user avatar
  • 559
11 votes

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). ...
Paul Smith's user avatar
10 votes

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 ...
Darren Engwirda's user avatar
9 votes

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 ...
Philip Roe's user avatar
  • 1,154
9 votes
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 ...
Wolfgang Bangerth's user avatar
8 votes
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 ...
Jesse Chan's user avatar
  • 3,142
8 votes

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 (...
Wolfgang Bangerth'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

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 ...
Wolfgang Bangerth's user avatar
6 votes
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 ...
Wolfgang Bangerth's user avatar
6 votes

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 ...
ti7's user avatar
  • 161
6 votes

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 ...
PatrickT's user avatar
  • 161
5 votes
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 ...
cfdlab's user avatar
  • 3,028
5 votes
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 ...
Rover's user avatar
  • 128
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

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 ...
Mithridates the Great's user avatar
5 votes

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 ...
EMP's user avatar
  • 2,089
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

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 ...
Dan Doe's user avatar
  • 1,083
4 votes
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., ...
Wolfgang Bangerth's user avatar
4 votes

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 ...
rchilton1980's user avatar
  • 4,906
4 votes

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 ...
GoHokies's user avatar
  • 2,216
4 votes
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 ...
origimbo's user avatar
  • 2,249
4 votes
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 ...
Savithru's user avatar
  • 343
4 votes
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 ...
Vikram's user avatar
  • 489
4 votes

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 ...
MPIchael's user avatar
  • 2,935
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,935
4 votes
Accepted

Test functions of Raviart-Thomas elements?

Why not try drawing the basis? You use Raviart-Thomas basis to approximate a vector field so a quiver plot makes sense. This basis function (one out of three) is associated with the left edge. It is ...
knl's user avatar
  • 2,104

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