Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6893383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:39:05+00:00 2026-05-27T06:39:05+00:00

i hope the title itself was quite clear , i am solving 2D lid-driven

  • 0

i hope the title itself was quite clear , i am solving 2D lid-driven cavity(square domain) problem using fractional step method , finite difference formulation (Navier-Stokes primitive variable form) , i have got u and v components of velocity over the entire domain , without manually calculating streamlines , is there a command or plotting tool which does the job for me?

i hope this question is relevant enough to programming , as i need a tool for plotting streamlines without explicitly calculating them.

I have solved the same problem in stream-vorticity NS form , i just had to take contour plot of stream function to get the streamlines.

I hope that tool or plotter is a python library, and morevover installable in fedora (i can compromise and use mint)without much fuss!!

i would be grateful if someone points out the library and relevant command (would save a lot of time)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:39:06+00:00Added an answer on May 27, 2026 at 6:39 am

    Have a look at Tom Flannaghan’s streamplot function. The relevant thread on the user’s list is here, and there’s also another similar code snippet by Ray Speth that does things slightly differently.

    If you have problems with speed, it might be more efficient to use some of scipy’s integration functionality instead of the pure-numpy integration functions used in both of these examples. I haven’t tried it, though, and these deliberately avoid a dependency on scipy. (scipy is a rather heavy dependency compared to numpy)

    From it’s example plot:

    import matplotlib.pyplot as plt
    import numpy as np
    from streamplot import streamplot
    
    x = np.linspace(-3,3,100)
    y = np.linspace(-3,3,100)
    u = -1-x**2+y[:,np.newaxis]
    v = 1+x-y[:,np.newaxis]**2
    speed = np.sqrt(u*u + v*v)
    
    plt.figure()
    plt.subplot(121)
    streamplot(x, y, u, v, density=1, INTEGRATOR='RK4', color='b')
    plt.subplot(122)
    streamplot(x, y, u, v, density=(1,1), INTEGRATOR='RK4', color=u,
               linewidth=5*speed/speed.max())
    plt.show()
    

    enter image description here

    Another option is to use VTK. It’s accelerated 3D plotting, so making a 2D plot will require setting the camera properly (which isn’t too hard), and you won’t be able to get vector output.

    Mayavi, tvtk, and mlab provide pythonic wrappers for VTK. It has lots of functionality along these lines.

    The easiest way to use VTK to plot streamlines from numpy arrays is to use mayavi.mlab.flow. I’ll skip an example for the moment, but if you want to explore using VTK to do this, I can add one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope the title and following text are clear, I'm not very familiar with
I hope the title of this question is somewhat clear, I couldn't figure out
I hope the title did not mislead you. My problem is the following: Currently
I had some problem formulating the question in the title, but i hope you
I hope that title is clear enough. I have 2 projects, MyProject.Website (ASP.NET MVC3
I hope my question is clear from the title. But still I will explain
Hope the title was OK. My problem is that I want to generate an
I hope the title is clear. I would like to retrieve the existing google
I hope the title is describing the problem, i'll change it if anyone has
I hope the title makes sense. I have a set of items that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.