Skip to content

rik-stra/TO_IncompressibleNavierStokes.jl

 
 

Repository files navigation

TO_IncompressibleNavierStokes

This package implements the tau-orthogonal (TO) method, a data-driven SGS modeling framework for three-dimensional turbulent flows. It is build on top of the IncompressibleNavierStokes solver package. Most of the extensions can be found in RikFlow.

Paper

The extension of the tau-orthogonal method to 3D flows is presented in the paper "Reduced Subgid Scale Terms in Three-Dimensional Turbulence".

The code to reproduce the results in this paper can be found in the branch "clean_July2025_freeze".

Logo Logo

IncompressibleNavierStokes

DOI

This package implements energy-conserving solvers for the incompressible Navier-Stokes equations on a staggered Cartesian grid. It is based on the Matlab package INS2D/INS3D. The simulations can be run on the single/multithreaded CPUs or Nvidia GPUs.

This package also provides experimental support for neural closure models for large eddy simulation.

Installation

Note that IncompressibleNavierStokes requires Julia version 1.9 or above.

See the Documentation for examples of some typical workflows. More examples can be found in the examples directory.

Gallery

The velocity and pressure fields may be visualized in a live session using Makie. Alternatively, ParaView may be used, after exporting individual snapshot files using the save_vtk function, or the full time series using the VTKWriter processor.

Actuator (2D) Backward facing step (2D) Decaying turbulence (2D) Taylor-Green vortex (2D)
Actuator (3D) Backward facing step (3D) Decaying turbulence (3D) Taylor-Green vortex (3D)
Rayleigh-Bénard (2D) Rayleigh-Bénard (3D) Rayleigh-Taylor (2D)

Demo

Make sure to have the GLMakie and IncompressibleNavierStokes installed:

using Pkg
Pkg.add(["GLMakie", "IncompressibleNavierStokes"])

Then run run the following code to make a short animation:

using GLMakie
using IncompressibleNavierStokes

# Setup
setup = Setup(
    x = (tanh_grid(0.0, 2.0, 200, 1.2), tanh_grid(0.0, 1.0, 100, 1.2)),
    boundary_conditions = ((DirichletBC(), DirichletBC()), (DirichletBC(), DirichletBC())),
    temperature = temperature_equation(;
        Pr = 0.71,
        Ra = 1e7,
        Ge = 1.0,
        boundary_conditions = (
            (SymmetricBC(), SymmetricBC()),
            (DirichletBC(1.0), DirichletBC(0.0)),
        ),
    ),
)

# Solve equation
solve_unsteady(;
    setup,
    ustart = velocityfield(setup, (dim, x, y) -> zero(x)),
    tempstart = temperaturefield(setup, (x, y) -> 1 / 2 + sinpi(30 * x) / 100),
    tlims = (0.0, 30.0),
    Δt = 0.02,
    processors = (;
        anim = animator(;
            setup,
            path = "temperature.mp4",
            fieldname = :temperature,
            colorrange = (0.0, 1.0),
            size = (900, 500),
            colormap = :seaborn_icefire_gradient,
            nupdate = 5,
        ),
    ),
)

Similar projects

About

TO method for reduced subgrid scale modelling on Incompressible Navier-Stokes solver

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Julia 85.2%
  • Jupyter Notebook 14.2%
  • Shell 0.6%