153 questions
0
votes
0
answers
32
views
How to remove gray outlines appearing around my fluid? (Fluid simulation based on Jos Stam's paper)
weird gray outline image 1 weird gray outline image 2
I'm working on a fluid simulation based on Jos Stam's paper, but instead of just one density array, there are three density arrays for each color (...
1
vote
0
answers
49
views
Frictionless pipe using the Modelica Fluid library
I'm trying to obtain a frictionless pipe model starting from a dynamicPipe model.
In order to do so, I modified the dynamicPipe model as:
extends PartialStraightPipe_noFric(final port_a_exposesState = ...
0
votes
0
answers
52
views
MICCG(0) for a fluid simulation fails at Neumann boundaries
I am trying to follow Robert Bridson's Fluid Simulation Notes (https://www.cs.ubc.ca/~rbridson/fluidsimulation/fluids_notes.pdf) to implement my own eulerian fluid simulator for the first time.
I was ...
1
vote
0
answers
59
views
How can I optimize the SPH part (OpenCL) of my N-Body-Simulation
I implemented a N-body simulation that combines gravity and SPH (smoothed particle hydrodynamics). I want to optimize the SPH part. I use spacial hashing for the neighborhood search. On the host side (...
0
votes
2
answers
165
views
A water animation with velocity heatmap and changing surface level in python
I am trying to make an animation of water from data I generated from a simulation.
I have two datasets (Hraw and Uraw) with identical dimensions with x-coordinates and time coordinates. Uraw also ...
0
votes
1
answer
69
views
Stable fluid simulation with Python and Taichi has strange drifting
I'm trying to implement Jos Stam's stable fuild in paper: https://graphics.cs.cmu.edu/nsp/course/15-464/Spring11/papers/StamFluidforGames.pdf
I want to do it in 2D but do wraparound when you hit the ...
0
votes
2
answers
168
views
Varying the arrowsize proportional to the linewidth in streamplots (matplotlib: 3.5.1)
I have fluid flow data, that has some vortices that decay in strength with distance in one direction. An easy example of this is below.
import numpy as np
# model flow field
x = np.linspace(0, 2 * np....
0
votes
1
answer
204
views
Vorticity Function Yielding Peculiar Result
I am working with a lid-driven cavity flow problem, using the discretised versions of the vorticity Navier-Stokes equations:
For some reason, my stream function seems to be working (I believe so, at ...
0
votes
1
answer
312
views
Fluid Dynamics - Lid driven cavity flow- why is only the first row updated, while I iterate over all grid cells?
I have to simulate a lid driven cavity flow. The idea is as follows:
Initialize boundary conditions
Update stream function (using discretized version, update only if the convergence condition is ...
0
votes
1
answer
52
views
Why my adhesion force is increasing when I increase the number of points
Here is my implementation of the adhesion force equation:
function adh = adhesionScheme(o,H, delta, m, n,walls,wallsInt,wallsExt)
% flag whether we have walls or not
confined = 0;
if ~isempty(walls) |...
1
vote
0
answers
43
views
Four 1st order IVP ODE by Runge-Kutta 4th order scheme in C getting damped
I am currently working on a simulation project involving a two-degree-of-freedom (2DOF) airfoil. The motion of this airfoil is governed by the following equations of motion:
To numerically solve ...
1
vote
1
answer
373
views
Finite basis physics-informed neural networks (FBPINNs) JAX problem
I am trying to modify Ben Moseley's code available on github https://github.com/benmoseley/FBPINNs.
My intention is to insert a vector of values into the loss fn that is dependent on x y coordinates, ...
1
vote
1
answer
169
views
Obi Fluid in Unity - changing solver gravity vector has no effect on particles
I have a scene in Unity that uses Obi Fluid. The flow of the fluid can be controlled by rotating the Obi solver's gravity vector in response to WSAD (or the gyroscope input when running on a mobile ...
1
vote
0
answers
50
views
Performing Eulerian flow analysis on this problem
I am attempting to find the governing equation for the Position(x,y,t) and Orientation θ(x,y,t) of these pellets, which collectively behave as a fluid. To perform flow analysis and find governing ...
0
votes
1
answer
99
views
How can turbulence length scale be estimated from hydraulic diameter in pipe flow?
I want to model turbulent flow in fully developed pipe flow using an eddy diffusion coefficient K [m^2/s]. Using gradient diffusion theory, K can be obtained as
K = u * x
where u [m/s] denotes a ...
0
votes
0
answers
205
views
How can i make my particles act more like a fluid
I am trying to create a fluid simulation using sph in javascript i have finally calculated everything so the particles receive a force but the force doesnt seem to work properly and just pushes the ...
0
votes
1
answer
109
views
Access a cluster via SSH in a Java macro
I have a Star-CCM (CFD software) java macro that tells the CFD simulation to run on my local machine,through the line:
simulation_0.getSimulationIterator().runAutomation();
I want to tell Star-CCM to ...
0
votes
0
answers
156
views
How should I apply boundary conditions to a pressure field in a 2D cfd simulation?
I'm coding a 2D incompressible unsteady Navier-Stokes solver to compute airflow over and under a shape. The program uses MAC method with a staggered grid with ghost cells on boundary conditions for ...
0
votes
0
answers
53
views
Pressure ratio vs Friction and other geometric factors
The problem I am facing consists of plotting the graph I attach, only the discontinuous lines at the moment.
.
For that purpose I need to take into account these equations:
.
Before starting ...
3
votes
1
answer
127
views
How to reverse the SweptVolume block?
I'm trying to simulate a simple case. One sweptVolume is connected to another one. Flange.b to flange.b like that:
When the pressure in the OilChamber is rising, the volume expands, and the piston ...
1
vote
0
answers
134
views
Getting unexpected values for Characteristic Lyapunov Exponents in Python - What could be going wrong with my implementation of Benettin algorithm?
I wrote a code to calculate the Characteristic Lyapunov Exponents in Python for a Lorenz system. I for sure did something wrong because the CLEs are way off but I cannot figure out what.
I am using ...
1
vote
1
answer
905
views
3D Lattice Boltzmann Method Python
I'm trying to understand how to implement a lattice Boltzmann simulation of a simple 3D object in python.
I would like to see the the object and flow in 3D but i can't find the right resources.
Can ...
-4
votes
2
answers
128
views
I am having a hard time converting fluid dynamics equation into MATLAB code
I converted these two equations into MATLAB code before but I lost the file and now I am trying to write them again but there is a problem and I can't figure it out.
This is the main equation:
This ...
1
vote
1
answer
99
views
Fluid simulation tutorial in javascript, values never initialized?
I am looking at this snippet in a fluid simulation tutorial.
I have searched for where those values are initialised and it seems they are never written to? There is a line that initialises the array ...
0
votes
0
answers
879
views
blockMesh Error during Meshing using OpenFOAM because of the boundary
I am trying to generate a mesh for a flow around a cylinder to model turbulence. Basically, a cylinder inside a rectangle. The problem is, with the right wall boundary (line number 215) in ...
0
votes
1
answer
148
views
Why does this simulation "explode"?
I am attempting to simulate a steerable vehicle (plane, hovercraft, boat) in a fluid (gas or liquid, e.g. air or water).
My JavaScript implementation is based on the 3D rigid body airplane simulator ...
0
votes
1
answer
112
views
Detect Fluid Pathlines in Images
I have several thousand images of fluid pathlines -- below is a simple example --
and I would like to automatically detect them: Length and position.
For the position a defined point would be ...
0
votes
0
answers
323
views
Fortran - Lid-Driven Cavity Boundary Conditions Error when using SIMPLE method
I am studying Numerical Methods for incompressible flows. Part of the tasks is to model the lid-driven cavity problem in 2D using the SIMPLE method.
I have been provided with Fortran code that is ...
0
votes
0
answers
341
views
CFD in C++, Lattice boltzmann method, I dont know what im doing
I'm trying to create my own CFD in C++. I have watched some videos on youtube about the Lattice Boltzmann method, but I cant get my simulations to look like the simulations performed in the videos ...
0
votes
0
answers
127
views
Solving system of nonlinear equations numerically in python
I want to solve the following problem numerically and first defined it as a function:
def F(x, na=1, nb=2, L=6, A=0.09, V=0.54, dh=0.03, k=10**-2, dB=0.005, fB=38, ur=0.39, rhoW=998, rhoG=1.2, g=9.81, ...
0
votes
0
answers
494
views
Time loop won't start with simpleFoam on openfoam
I started doing my first project after having done some tutorials on openfoam.
So I just did a simple Ahmed Body.Blockmesh and Snappyhexmesh are both running, I checked the mesh and it seems fine(even ...
0
votes
1
answer
811
views
Rendering 2D vertical fluid movement/physic with Javascript
I'm trying to find data and examples for 2D fluid movements and physics that could be rendered using webGL or 2d-canvas.
My objective is to reproduce the animation that we can see for example on this ...
1
vote
1
answer
185
views
What is causing this 2D fluid simulation to hang?
I attempted to build a fluid simulator based off the architecture of Jos Stam's book, The Art of Fluid Animation, only I'm using node.js and canvas-sketch. I think I can finagle it to work, it's just ...
2
votes
1
answer
552
views
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 ...
3
votes
0
answers
376
views
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 ...
0
votes
1
answer
215
views
How can I use the SimpleGenericOrifice of the Modelica Standard Library to impose pressure loss in a pipe?
I would like to model an hydraulic network where I use the Modelica.Fluid.Fittings.SimpleGenericOrifice as a seal so I can impose the pressure loss of a pipe. Using the formula in the documentation, I ...
2
votes
0
answers
186
views
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 ...
1
vote
0
answers
197
views
Can I use periodic boundary conditions for `U` but not for `p`?
I am trying to numerically compute the drag force around a cylinder due to pressure-driven flow. Here is a crude diagram:
I am using OpenFOAM v2012 (the openfoam.com version, not the openfoam.org ...
1
vote
0
answers
77
views
Getting different results when using pgfortran vs. gfortran for same exact problem
In a computational fluid dynamics solver I have written, I am getting a different result based on the compiler I use. When I compile this code using gfortran with the following flags:
-ffree-line-...
-1
votes
1
answer
274
views
Pressurized vessel in modelica [closed]
I've been trying to create a pressurized vessel in openmodelica but i'm stuck.
The block i'm trying to build is a simple vessel for liquid pressurized by gas.
So two input ports (liquid input, gas ...
1
vote
0
answers
127
views
GPU Viscoelastic Fluid Sim
I am trying to implement this paper for viscoelastic fluid simulation - http://www.ligum.umontreal.ca/Clavet-2005-PVFS/pvfs.pdf - to run on the GPU (using iOS Metal). The paper uses a particle-based ...
1
vote
0
answers
90
views
Nonlinear differential equation, How can I solve this numerically with matlab?
https://i.sstatic.net/6x1ju.png
I have to solve f"'+(4a^2+Re*f)f'=0 where a and Re is constant but variable. There are three BCs, f(1)=0,f(-1)=0 , ∫F(∅)d∅=1(integral -1 to 1)
Now I had an idea to ...
0
votes
0
answers
122
views
Persisting medium issue after defining Medium in Open Modelica
In Open Modelica Fluid Environment, I´m seeing the Error
"Medium is partial, name lookup is not allowed in partial classes." Which is commonly solved properly defining the media in each ...
0
votes
1
answer
2k
views
COMSOL: Diffusion in Transport of Diluted Species Produces Unphysical Results
I am simulating Transport of Diluted Species inside a pipe segment in COMSOL Multiphysics. I have specified an initial concentration which produces a concentration distribution around a slice through ...
1
vote
1
answer
613
views
Warning when adding Brownian force in COMSOL Multiphysics
I want to add a Brownian Force to my COMSOL simulation. Unfortunately, I get the warning shown below and I do not understand how to get rid of it.
I am unsure what "second-order wall ...
1
vote
1
answer
764
views
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 ...
0
votes
1
answer
1k
views
How to visualize a vtu file in python?
I am using meshio package to extract the information out of a vtu file that represents the 2d version of flow past a cylinder (Von-Karman vortices) at a Reynolds no. of 220 for one time-step.
I am ...
0
votes
1
answer
300
views
FiPy Modelling water pumping with FiPy
I am trying to model water pumping with Fipy in a domain where I want to simulate diffusion and advection. Water is extracted from one point, and is discharged in another point. However, I am having ...
0
votes
1
answer
185
views
How to add or delete fluid in LBM(lattice boltzmann method)
LBM focuses on fluid clusters, and uses the macro fluid density and velocity to calculate the equilibrium distribution function, and then uses the evolution equation to achieve system iteration. But ...
0
votes
2
answers
65
views
(Computational fluid dynamics) Problem with arrays. Why is my C program outputting -1.#IND00
I have a problem with a program i'm writing in C that solves the 1D linear convection equation. Basically i have initialized an two arrays. The first array (u0_array) is an array of ones with the ...