Coder Social home page Coder Social logo

edocipriano / fassa Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 4.62 MB

Geometric VOF interface advection using an Eulerian Implicit method (Weymouth and Yue) and field operations on cartesian grids.

License: MIT License

Python 57.73% Fortran 9.20% C++ 28.06% C 4.78% Shell 0.23%
vof advector fvm navier-stokes

fassa's Introduction

Fassa

Geometric VOF interface advection using an Eulerian Implicit method (Weymouth and Yue) and field operations on cartesian grids.

Val di Fassa

Fassa does not stand for Fast Adaptive Simulator Something... (it is not adaptive neither fast). Instead, it is named after Val di Fassa, which is a beautiful valley located in the middle of Italian Dolomites. It is also where I wrote this code, which was simply intended as a school project.

Geometric VOF Interface Advection

In CFD, the Volume Of Fluid (VOF) approach can be used to describe a two-phase system, by defining a scalar marker function f which represents the volume fraction of a reference phase in each computational cell of the domain. This volume fraction takes value of 1 in the pure phase, 0 in the other phase, and intermediate values at the interface between the two phases. Advecting the interface according to the velocity field can be achieved from the solution of the following advection equation:

$$\frac{\partial f}{\partial t} + u\cdot\nabla(f)=0$$

Fassa solves this equation using a geometrical discretization technique of the advection term, in order to avoid interface smearing. The implemented approach was proposed by Weymouth and Yue, it requires a uniform cartesian grid, and it is conservative if a divergence-free velocity field u is provided.

Weymouth, Gabriel D., and Dick K-P. Yue. "Conservative volume-of-fluid method for free-surface simulations on cartesian-grids." Journal of Computational Physics 229.8 (2010): 2853-2865

Requirements

Fassa is written in python3 and it just requires numpy. The volume fraction fields are initialized using the Vofi library which must be installed only if different configurations needs to be simulated. The simulation results are .vtk files that can be visualized using Paraview.

Installation using 'pip'

$ git clone https://github.com/edocipriano/fassa.git
$ cd fassa
$ python3 setup.py bdist_wheel
$ pip3 install dist/fassa-1.1.0-cp38-cp38-macosx_11_0_x86_64.whl

The path of the last instruction may change based on the OS, and the version of the package.

Structure

Fassa is organized in three main folders: paris, fassa, run.

  • fassa: the main module of this project. It contains a small collection of classes and functions that allow to easily peform VOF simulations, to solve the pressure-velocity coupling using a fairly simple Projection Method, and to write the simulation results in vtk format.
  • paris: a module that contains a few functions taken from the Paris simulator code. These functions are written in fortran and compiled using f2py in order to be imported from the python code. This module performs geometric operations, such as finding the interface normal using the Young's method, finding the plane constant, and cutting a cubic cell with a plane in order to find the fraction of cell occupied by the reference phase.

Aniszewski, Wojciech, et al. "Parallel, robust, interface simulator (PARIS)." Computer Physics Communications 263 (2021): 107849.

  • run: contains examples of simulations performed using fassa. The most remarkable cases are vortex and zalesak, which are classical VOF-advection benchmark simulations. In these simulations, a circle is advected by a prescribed velocity field and the final configuration is compared with the initial position of the circle, in order to test the accuracy of the implemented advection method.

Tryggvason, Grétar, Ruben Scardovelli, and Stéphane Zaleski. Direct numerical simulations of gas–liquid multiphase flows. Cambridge university press, 2011.

Run

After the installation process, one can simply run the examples typing:

$ cd run/vortex
$ python3 vortex.py

The simulation will create a folder called results where the vtk results are stored. After some post-processing using Paraview, the vortex results will look like this:

vortex

fassa's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.