Coder Social home page Coder Social logo

pyfm's Introduction

pyfm

Python script that creates a mesh around an airfoil to be used in CFD analysis. The mesh is generated using the Gmsh api.

How to install:

To install the package from pip, use the code below:

Linux

pip3 install git+https://https://github.com/lucasralves/pyfm

Windows (not tested)

pip3 install -e git+https://https://github.com/lucasralves/pyfm#egg=pyfm

How to use it:

import pyfm

file = 'file.txt'         # file containing the airfoil points
ns = 100                  # number of points on the profile surface
nt = 5                    # number of points on the trailing edge
nf = 30                   # number of layers in the boundary layer
delta = 0.1               # boundary layer height
exp1 = 1.1                # expansion ratio of points on the surface towards the leading edge
exp2 = 1.1                # expansion ratio of points on the surface towards the trailing edge
exp3 = 1.1                # boundary layer expansion ratio
ext_radius = 10.0         # outer countor radius
ext_cell_size = 1.0       # size of the element on the outer counter
out_file = 'out_file.msh' # output file
gmsh_view = True

pyfm.init(file, ns, nt, nf, delta, exp1, exp2, exp3, ext_radius, ext_cell_size)
pyfm.build_surface()
pyfm.show_surface()
pyfm.build_mesh(out_file, gmsh_view=gmsh_view)

Mesh

The surface mesh, created by the function 'pyfm.buid_surface(...)', can be seen by calling 'pyfm.show_surface()'.

The volume mesh contain two regions, one close to the wall made of quadrangular elements that comprises the boundary layer, and a second region made of triangular elements.

The triangular region is divided into four parts, in order to maintain a refined region closer to the airfoil.

There are 4 physical groups, foil, external, laterals and volume, that can be used to set the boundary conditions.

pyfm's People

Contributors

lucasralves avatar

Stargazers

 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.