In physics, fluid dynamics is a subdiscipline of fluid mechanics that deals with fluid flow—the natural science of fluids (liquids and gases) in motion.
Questions tagged [fluid-dynamics]
146 questions
3
votes
1 answer
Compute stream function from x- and y- velocities by integration in python
I'm trying to compute the stream function of a 2D flow given the x- and y- velocity components. I'm using this definition of stream function:
And I tried this method as suggested here, which basically suggests you to integrate one row of…

Jason
- 2,950
- 2
- 30
- 50
3
votes
1 answer
How can I assign values to a surface in matlab?
I am trying to build a 3D CFD pipe flow model using MATLAB, and I am hoping to assign values (boundary conditions) on the pipe wall. I've tried building a pipe using the cylinder function:
[X Y Z] = cylinder
but this generates me several points on…

user2021060
- 31
- 2
3
votes
0 answers
C2R FFT on CUDA (CUFFT) produces different results than FFTW
I'm working over transforming some code from using FFTW library to CUFFT (CPU computing to GPU computing). I need to transform a matrix of forces, make some math on it and transform it back. Operation in FFTW looks like it:
fftw_real u0[DIM *…

aerion
- 702
- 1
- 11
- 28
2
votes
1 answer
how to convert velocity map to fluid flow map
It may be a very simple question, if you have the answer please share.
Provided a series (say for t0..tn) of the matrices (2D arrays) of velocities in X and Y directions (UX,UY) by means of application of Lattice Boltzmann method (LBM) on the…

Developer
- 8,258
- 8
- 49
- 58
2
votes
1 answer
Converting 2d Shallow Water Equations to 1d
I'm trying to create a shallow simulation in 1d (sort of like this), and I've been experimenting with this guide to 2d Shallow Water Equations. However, I don't understand the math all too well, and was wondering if anybody could help me figure out…

cytocracy
- 21
- 1
2
votes
0 answers
How to calculate the path of a particle subject to a vortex?
I'm trying to draw a path of a particle starting at (x0,y0) subject to a vortex located at (xv,yv). This is inspired by Lorena Barba's AeroPython. As stated in the lesson, the motion should be concentric circles about a given point.
I first…

Ross Mariano
- 331
- 2
- 8
2
votes
0 answers
How can I create a non-rectangular wedge domain in Numpy
I am doing some computational fluid dynamics (CFD) simulations for some research, and I have come across a paper that I would like to build upon.
In principle, I am trying to simulate flows and viscosities etc inside a triangular shaped container.…

Johnny
- 320
- 3
- 12
2
votes
1 answer
Knowing the velocity field, how can I find the trajectory of a "massless" particle inside that velocity field?
x,y = np.meshgrid(np.linspace(-8,8,30),np.linspace(-8,8,30))
q=3
w=10
freq=2
wavelenght=0.6
r=x**2+y**2
u=np.zeros((len(x),len(y)))
v=np.zeros((len(x),len(y)))
for i in range(0,len(x)):
for j in range (0,len(y)):
if (r[i,j]<=q**(3/4)):
…

Charbel Abetian
- 21
- 1
2
votes
0 answers
Pressure drop in Modelica.Fluid.Pipes.DynamicPipe when dynamic momentum balance is taken into account
I have a problem in understanding the simulation results of a discretized Modelica.Fluid.Pipes.DynamicPipe when using a compressible gas as medium and taking the dynamic momentum balance into account.
To illustrate that I built up a very simple…

Karin
- 43
- 4
2
votes
0 answers
How to import non-Newtonian model in FEATOOL Multiphysics?
I am using FEATool Multiphysics. I have a MATLAB function named ex_nonnewtonian1.m, which is supported by FEATool itself and contains the definition of a power-law non-Newtonial model. This file wasn't added to FEATOOL, so I need to add it…

Ahmed Naji
- 21
- 2
2
votes
4 answers
I need to input the friction factor from the Approximations of the Colebrook equation in python
I am trying to code an approximation of the Colebrook equation to obtain the friction factor. I have achieved this in Matlab but when it come to python my code does not work.
import math
Re = 2300
eD=0.0009…

yamifm0f
- 65
- 4
2
votes
1 answer
Running code inside (do ...) in Scheme (Fluent) executes differently than outside the loop
A sequel to my previous question:
I'm using the ANSYS Fluent program for CFD simulations. This program allows some partial automation of the simulation setup using a so-called Journal File, and I just came to know that this Journal File is written…

The Drunken Whaler
- 133
- 4
2
votes
3 answers
Quantify roughness of a 2D surface based on given scatter points geometrically
How to design a simple code to automatically quantify a 2D rough surface based on given scatter points geometrically? For example, to use a number, r=0 for a smooth surface, r=1 for a very rough surface and the surface is in between smooth and rough…

Yongxin
- 173
- 2
- 9
2
votes
1 answer
JScience: Create a unit that is defined as a combination of multiple variables
I discovered JScience a couple months ago and it has been a huge help for my project, though I'm struggling with one thing.
I'm trying to create a PressureHead (aka water column) unit that can be converted directly with Length and indirectly with…

Pilot_51
- 7,337
- 3
- 29
- 26
2
votes
1 answer
Riding the wave Numerical schemes for hyperbolic PDEs, lorena barba lessons, assistance needed
I am a beginner python user who is trying to get a feel for computer science, I've been learning how to use it by studying concepts/subjects I'm already familiar with, such as Computation Fluid Mechanics & Finite Element Analysis. I got my degree in…