CFD Online Logo CFD Online URL
Home > Forums > General Forums > CFD Freelancers

3d python sim blowing up

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By bburgess

LinkBack Thread Tools Search this Thread Display Modes
Old   December 28, 2019, 18:07
Default 3d python sim blowing up
New Member
Join Date: Dec 2019
Posts: 1
Rep Power: 0
bburgess is on a distinguished road
I have a 3d python fluid simulation that is giving some unexpected behavior. I've been following this tutorial:, and have been trying to extend it to 3d.

relevant code is in here:, the NS_Lorena_Barba file, at the bottom where it says 3D.

The ICs in all cases so far are that a small region of the fluid has a velocity in the +x direction.

Even starting with linear convection, something is weird: the region shifts in the +z direction, though the flow vectors are still exclusively in the +x direction.

Nonlinear convection seems to be fine, though the only thing that I changed was that what was a constant velocity is now the local velocity.

Lastly, Diffusion is proving problematic, the velocity vectors get enormous, and are pointing in both the +x and -x directions (I'd expect the flowing region to get larger and slower, not reverse direction).

Does anyone have any ideas of where the bugs are, or where the code is wrong? Thanks!
rmaries likes this.
bburgess is offline   Reply With Quote

Old   January 18, 2020, 00:16
New Member
Join Date: Jan 2015
Posts: 6
Rep Power: 9
appollosputnik is on a distinguished road
I can help you get rid of your problem, please message me to my email id ''
appollosputnik is offline   Reply With Quote

Old   February 21, 2020, 03:52
New Member
Sen Wang
Join Date: Jul 2018
Location: Singapore / Notre Dame, U.S.
Posts: 18
Blog Entries: 1
Rep Power: 6
wangsen992 is on a distinguished road
Hi I just saw your post and i'm wondering if your problem is already solved? Normally the errors you've mentioned could be due to several common reasons:
1. A bug in the code, commonly a wrong sign somewhere.
2. Pressure correction iteration is not sufficiently done to ensure the continuity constraints on velocity field, which usually leads to errors blow up and velocity field gotten all whacky.
3. Have you check your Courant number to ensure the time step and grid size are chosen appropriately? You should take into consideration of the mean velocity imposed.

Well, hope those are helpful and will be glad to help you if needed.
wangsen992 is offline   Reply With Quote


bug, navier-stokes solver, python
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with Python: Query of through-plane flow of multiple clips in one plot PedroInvierno EnSight 8 April 10, 2017 09:23
[] compile error with python characteristic activated shuoxue OpenFOAM Installation 1 February 6, 2016 17:05
[OpenFOAM] using the python shell in paraFoam colinB ParaView 14 September 14, 2015 09:04
[OpenFOAM] paraview v4 - building with python - OF2.3.0, PVv4, Python 2.7 aylalisa ParaView 4 June 13, 2014 08:52
Help with large sim stu CFX 7 June 4, 2007 17:13

All times are GMT -4. The time now is 01:42.