31 votes
Accepted

Plotting Joukowski Airfoil Streamlines using conformal maps

There is no simple method to display streamlines using the Zhukovsky function. I will show an example with a Zhukovsky profile at an angle of attack. ...
Alex Trounev's user avatar
  • 43.4k
29 votes

Nonlinear FEM Solver for Navier-Stokes equations in 2D

In Version 12.0 this has become much easier, as now there is a nonlinear finite element solver. Here is the code: Set up the region. ...
user21's user avatar
  • 39.4k
20 votes
Accepted

1D Euler equations (fluid dynamics) with NDSolve

Update-1: The initial conditions in the question were wrong/incomplete. (removed 1/0 errors) Update-2: The 1D Euler equations were modified to match this source. (ultimately not necessary in V10.4, ...
Young's user avatar
  • 7,485
17 votes
Accepted

Stable fluids code for electromagnetic mixture application

Let's Compile. ...
xzczd's user avatar
  • 65.4k
16 votes
Accepted

Solver for unsteady flow with the use of the Navier-Stokes and Mathematica FEM

Here is a result for your second test (update 2). Let me show how I tackled example c) 2D-3 (unsteady), page 4 from the cited paper. The reason I choose this example is that for example 2D-2 the ...
user21's user avatar
  • 39.4k
15 votes

How to create a fluid animation like this?

We cannot accurately reproduce what is shown in the animation, since the initial data are unknown. We can show a similar mixing process at the boundary of two oncoming flows. We use FEM and the NSE ...
Alex Trounev's user avatar
  • 43.4k
13 votes

Solving Navier-Stokes equations for a steady-state compressible viscous flow in a 2D axisymmetric step

I prepared a solver for the steady axisymmetric flow of a viscous incompressible fluid for Reynolds numbers up to 1000 (but it is possible more, up to loss of stability) in geometry, which the author ...
Alex Trounev's user avatar
  • 43.4k
13 votes
Accepted

Reciprocating flow in a channel over a heated surface

We can solve this problem with method proposed on my page. Solution1. We use nondimensional form of equations with scale d and $t_s = d^2/(k_f/(c_p \rho))$. We ...
Alex Trounev's user avatar
  • 43.4k
11 votes
Accepted

I failed to solve a set of one-dimension fluid mechanics PDEs with NDSolve

With the experience gained in past 6 years, I manage to find out a more efficient solution for this problem :D . This problem turns out to be another example on which the difference scheme ...
xzczd's user avatar
  • 65.4k
11 votes

The FEMDampingElements operator failed

FEM code for isentropic viscous flows. We can add the equation for temperature with $\chi $ function, but this almost does not affect the solution. A flow with the inlet/outlet pressure ratio $p_{in}/...
Alex Trounev's user avatar
  • 43.4k
11 votes
Accepted

Fourth order, nonlinear PDE depicting dynamics of liquid lenses

Yet another problem related to the hyperbolic conservation law. Based on the experience obtained in e.g. here, let's avoid symbolic expansion of D. I'll use ...
xzczd's user avatar
  • 65.4k
11 votes
Accepted

Refining mesh size leads to absurd results for a coupled heat transfer FEM model

This is a typical numerical instability due to FEM matrix inversion. On the fine mesh there are big numbers in Navier-Stokes equation of about $1/h^2$, therefore at $h\rightarrow 0$ we have singular ...
Alex Trounev's user avatar
  • 43.4k
10 votes
Accepted

Cylindrical coordinates in FEM

This appears to be a lid driven flow problem. I am in agreement with @user21's perspective that you should solve this in Cartesian Coordinates. It should simplify the boundary condition ...
Tim Laska's user avatar
  • 16.3k
10 votes

Stokes equations in 2D with traction boundary conditions

As mentioned user21 for setting traction boundary conditions we need to know normal and tangent to the surface which is subjected to loading. On the inner surface ($r=a$) for the unit tangent vector ...
Oleksii Semenov's user avatar
10 votes

Reciprocating flow in a channel over a heated surface

It seems that the main challenge in this problem is Dirichlet BC which should be switched periodically on $x=0$ and $x=L$. I don't know whether it possible to switch BC inside ...
Oleksii Semenov's user avatar
10 votes

What's wrong with this FFT-based Von Kármán vortex street simulation?

I found the index should start from 0 instead of 1. This affects the (squared) wave number k....
rnotlnglgq's user avatar
  • 3,740
9 votes
Accepted

Curved Dirichlet boundary in FEM

You could workaround the slip BC limitation by modeling a thin lubricated layer. I cannot take credit for the following code and my initial search did not find it in the Wolfram Function Repository. ...
Tim Laska's user avatar
  • 16.3k
8 votes

Circumvent NDSolve::bdord: error for 1-D Euler Equations

I managed to solve your equation set by adding a very small viscosity μ to the equation to circumvent the computational difficulty caused by the discontinuities ...
xzczd's user avatar
  • 65.4k
8 votes

1D Euler equations (fluid dynamics) with NDSolve

Here's a solution by adding a very small viscosity μ to Euler equations (notice Euler equations can be seen as particular Navier–Stokes equations with zero ...
xzczd's user avatar
  • 65.4k
8 votes
Accepted

Simplify fluid flow by using symmetry property

No need for Neumann BCs at all. The independent variables got messed up a bit. This works: ...
user21's user avatar
  • 39.4k
8 votes
Accepted

What's wrong with this FFT-based Von Kármán vortex street simulation?

Finally, rnotlnglgq finds the correct answer in time, so let me share my answer, too :) . First I'd like to explain a bit more about the theoretical basis of the mass conservation correction in the ...
xzczd's user avatar
  • 65.4k
8 votes

Solving third order DE from fluid dynamics

One can observe that the original equation can be simply integrated twice w.r.t. $x$, this yields: $$y'(x)+y(x)^2-c_2\; x+c_1=0 $$ We could choose arbitrarily signs of constants, now solving it ...
Artes's user avatar
  • 57.2k
7 votes
Accepted

Area/Volume of a 2D/3D object as it is filled up with water

Here is a fairly general solution that should work in any dimensions and will not allow you to overflow. ...
bRost03's user avatar
  • 2,072
7 votes
Accepted

How to display warning message inside manipulate?

Here is a quick way to do it. Just add another small window that shows the status. In there you can add messages. ...
Nasser's user avatar
  • 142k
6 votes
Accepted

Analytic solution to Orr-Sommerfeld-Squire equations for a special case

Dispersion relations for this question can be derived in a straightforward manner, as I described in an earlier comment above. Solve the two ODEs in turn but without boundary conditions. ...
bbgodfrey's user avatar
  • 61.3k
6 votes

Analytic solution to Orr-Sommerfeld-Squire equations for a special case

(1)&&(3) It is possible to construct analytical solutions for even and odd modes, using the boundary conditions at the center of the channel and on one of the walls. These solutions depend on ...
Alex Trounev's user avatar
  • 43.4k
6 votes

The FEMDampingElements operator failed

The issue here is that currently NDSolve with the finite element method can not handle non-constant coefficients for time derivatives. In order to work around that ...
user21's user avatar
  • 39.4k
6 votes
Accepted

Non-Newtonian Momentum Eqn in a rectangular pipe

We can use the FEM solver from here Solver for unsteady flow with the use of the Navier-Stokes and Mathematica FEM or from here https://community.wolfram.com/groups/-/m/t/1433064 Let's make a small ...
Alex Trounev's user avatar
  • 43.4k
6 votes

Stokes' second problem

The PDE along with the initial and boundary conditions constitute the famous Stokes second problem. Here a comparison has been made among Maple, Mathematica and COMSOL solving the same model. The ...
zhk's user avatar
  • 11.9k
6 votes
Accepted

Testing Turbulence Models

Seems that Alex has solved the problem himself, but I still want to compete for the bounty think it's still better to elaborate my points in the comments. It should be noted that, ...
xzczd's user avatar
  • 65.4k

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