fluid-dynamics

Strange oscillating ripples in my shallow water implementation

▼魔方 西西 提交于 2020-01-02 03:25:08
问题 I've been trying to implement the shallow water equations in Unity, but I've run in a weird bug. I get these strange oscillating ripples in my water. I made some screenshot: And a video you can find here: https://www.youtube.com/watch?v=crXLrvETdjA I based my code on the paper Fast Hydraulic Erosion Simulation and Visualization on GPU by Xing Mei. And you can find the entire solver code here: http://pastebin.com/JktpizHW (or see below.) Each time I use a formula from the paper, I added its

How do I use quiver in Python for polar?

烈酒焚心 提交于 2019-12-25 03:38:35
问题 Firstly, yes I have read previous threads and documentation about this issue, for example How to make a quiver plot in polar coordinates. This didn't help me all the way. Let me show you what I am working with and then some code. This is a converging canal, it shows a velocity/vector field. Clearly I only have a radial component, but it changes with the angle theta. This pattern of arrows repeats itself as we go down(stream) towards alpha. So it should be simple to plot, right. Here is the

Replacing number by variable or loop in Scheme (Fluent) doesn't work

被刻印的时光 ゝ 提交于 2019-12-11 07:39:23
问题 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 in Scheme. Unfortunately I never even heard of Scheme, I just know it's a Lisp dialect (which I also know nothing of). I'm trying to automate some boring tasks by using a loop to automatically set a bunch of parameters to my simulation. If I run this command from Fluent's command

Running code inside (do …) in Scheme (Fluent) executes differently than outside the loop

痴心易碎 提交于 2019-12-11 07:38:44
问题 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 in Scheme. Unfortunately I never even heard of Scheme, I just know it's a Lisp dialect (which I also know nothing of). I'm trying to automate some boring tasks by using a loop to automatically set a bunch of parameters to my simulation. If I run

Strange oscillating ripples in my shallow water implementation

為{幸葍}努か 提交于 2019-12-05 05:33:35
I've been trying to implement the shallow water equations in Unity, but I've run in a weird bug. I get these strange oscillating ripples in my water. I made some screenshot: And a video you can find here: https://www.youtube.com/watch?v=crXLrvETdjA I based my code on the paper Fast Hydraulic Erosion Simulation and Visualization on GPU by Xing Mei. And you can find the entire solver code here: http://pastebin.com/JktpizHW (or see below.) Each time I use a formula from the paper, I added its number as a comment. I tried different timesteps, for the video I used 0.02, lowering it just made it

Secant method solving for pipe diameter

試著忘記壹切 提交于 2019-12-04 06:24:31
问题 I am trying to write a program to solve for pipe diameter for a pump system I've designed. I've done this on paper and understand the mechanics of the equations. I would appreciate any guidance. EDIT: I have updated the code with some suggestions from users, still seeing quick divergence. The guesses in there are way too high. If I figure this out I will update it to working. MODULE Sec CONTAINS SUBROUTINE Secant(fx,xold,xnew,xolder) IMPLICIT NONE INTEGER,PARAMETER::DP=selected_real_kind(15)

Secant method solving for pipe diameter

孤者浪人 提交于 2019-12-02 11:41:41
I am trying to write a program to solve for pipe diameter for a pump system I've designed. I've done this on paper and understand the mechanics of the equations. I would appreciate any guidance. EDIT: I have updated the code with some suggestions from users, still seeing quick divergence. The guesses in there are way too high. If I figure this out I will update it to working. MODULE Sec CONTAINS SUBROUTINE Secant(fx,xold,xnew,xolder) IMPLICIT NONE INTEGER,PARAMETER::DP=selected_real_kind(15) REAL(DP), PARAMETER:: gamma=62.4 REAL(DP)::z,phead,hf,L,Q,mu,rho,rough,eff,pump,nu,ppow,fric,pres,xnew