Giter VIP home page Giter VIP logo

Comments (1)

marinlauber avatar marinlauber commented on June 3, 2024

Hi Florian,

Thanks for your message. I suppose you made sure to be up to date with the commits if you pulled some time ago.

For this relatively high Reynolds number you have to use an unpadded spectral method, that is set the flow solver to
flow = Fluid(512, 512, 2000, pad=1.)
such that only 512 modes are used. Padding the spectral method reduced the stability in this case. I was able to run it fine for 1 second on physical time. I have attached the code below and the resulting animation.

McWilliams512x512.mp4

Thanks, Marin

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time as t
from src.fluid import Fluid
from src.field import McWilliams

# build fluid and solver
flow = Fluid(512, 512, 2000, pad=1.)
flow.init_solver()
flow.init_field(McWilliams)

print("Starting integration on field.\n")
start_time = t.time()
finish = 1.

# loop to solve
while(flow.time<=finish):
    flow.update()
    if(flow.it % 100 == 0):
        print("Iteration \t %d, time \t %f, time remaining \t %f. TKE: %f, ENS: %f" %(flow.it,
            flow.time, finish-flow.time, flow.tke(), flow.enstrophy()))
        flow.write(file="fluid")

end_time = t.time()
print("\nExecution time for %d iterations is %f seconds." %(flow.it, end_time-start_time))

from 2d-turbulence-python.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.