Skip to main content
21 votes
Accepted

The real myth of GPU (specifically CUDA) really speed up FEM/CFD

Here's the deal with GPUs. On a GPU, every single core is slow. Really slow. However, you have thousands of cores. If you can effectively use the thousands of cores at a time, then your algorithm will ...
Chris Rackauckas's user avatar
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
14 votes
Accepted

Galerkin method: Test functions vs. Basis functions

Suppose that the solution $u$ of the PDE lives in some function space $X$. We'll write the PDE as a bilinear form $A(u, v) = f(v)$ for all $v$ in $X$, where $f$ is some element of the dual space $X^*...
Daniel Shapero'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
Accepted

What is the difference between MATLAB and FORTRAN?

When one uses a low–level programming language, e.g. C++ or FORTRAN, one essentially controls lots of things: how parameters are passed, how data structures are aligned in memory, what is the most ...
Sasha's user avatar
  • 901
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
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,162
8 votes

What is the difference between MATLAB and FORTRAN?

In general, you will be much more productive writing software in a higher-level language (e.g MATLAB) that has features useful in describing problems in your particular domain (e.g. matrices in ...
Bill Greene's user avatar
  • 6,229
8 votes

In Matlab, how can I be consistent with units?

Just simply by being consistent in all of my code? Yes this is the only way. Matlab or any other programming language does not know about units. They only know about numbers. As an example consider ...
cfdlab's user avatar
  • 3,038
8 votes
Accepted

In Matlab, how can I be consistent with units?

I would say that you have, mainly, two methods: Being consistent in all your code, as already suggested in another answer. For that purpose, I always keep a table like this one with me, since it ...
nicoguaro's user avatar
  • 8,582
8 votes

Limitations with dynamical systems vs. PDEs?

PDEs are a form of dynamical system where there is another continuous variable. Usually this is space, so you're looking at how things over time and space instead of just over time. Here's an ...
Chris Rackauckas's user avatar
8 votes
Accepted

Why are fluid simulations so hard?

At their core, simulation of realistic fluid behavior is difficult because of the length scales involved. If you have turbulent flow, as is common in hydrodynamic or magneto-hydrodynamic situations, ...
Wolfgang Bangerth's user avatar
7 votes

How can an engineering student become a computational scinece expert in a short time

There is no shortcut. Just like there is no shortcut to becoming an "engineering expert in a short time". The thing is that to be an expert in civil engineering, you need to understand load analysis, ...
Wolfgang Bangerth's user avatar
7 votes

Practical coding resources for new CFD practicioners

Depends on what you mean by CFD. I would differentiate between academic and applied approaches. For academic purposes -- say, for acquisition of skills in numerical analysis and scientific computing ...
Jan's user avatar
  • 3,418
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,038
6 votes

How to discretize the surface of a prolate spheroid?

A spheroid is really just a sphere that has been squashed in the different coordinate directions. So to get a mesh for a spheroid is the same as getting a mesh for a sphere: start with the latter, ...
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
6 votes
Accepted

Can Julia be used to create a large-scale CFD software like OpenFOAM?

I think the question is just too subjective to answer. In the end, there are excellent C++ libraries for nearly everything that has to do with the solution of PDEs, whereas they are largely missing in ...
Wolfgang Bangerth's user avatar
6 votes
Accepted

Finite difference methods in cylindrical and spherical co-ordinate systems

There are basically two methods: You can disrectize the angular part via grid points, or you can discretize it via basis expansion. I will focus on spherical symmetry here, the cylindrical case is ...
6 votes
Accepted

Simulating the behavior of falling peas

As always, answers to questions of this kind will be of the form "it depends". What it depends on is how many peas you have. If you only have a few dozen peas that dribble out of the ...
Wolfgang Bangerth's user avatar
5 votes

The real myth of GPU (specifically CUDA) really speed up FEM/CFD

To extend Chris Rackauckas's exhaustive answer with a reference try to look pdf by Torres, Gonzalez-Escribano, Llanos. It is about the tuning of a gpu, that is an important aspect for performance. ...
Mauro Vanzetto's user avatar
5 votes
Accepted

Can we simulate compressible flows by simple direct explicit calculation, without solving systems of linear equations (such as Poisson eq)?

Physically, vorticity can only be created (as opposed to transported, stretched or intensified after being created) either by the appearance of a boundary layer on a solid surface, or through the ...
Philip Roe's user avatar
  • 1,154
5 votes

Galerkin method: Test functions vs. Basis functions

I'll try to give a short answer. Basis functions are those that you want in your solution. Test functions are those that you don't want in your residual. You want them to be same in Bubnov-Galerkin ...
Johntra Volta'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

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