Giter Site home page Giter Site logo

didsustechfxxkedup / of.yaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iydon/of.yaml

0.0 0.0 0.0 8.44 MB

Python Interface to OpenFOAM Case (Configured Using YAML)

Home Page: https://pypi.org/project/ifoam

License: GNU General Public License v3.0

Python 91.21% Makefile 1.15% YAML 7.65%

of.yaml's Introduction

Contributors Forks Stargazers Issues GPL-3.0 License


Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact

About The Project

This repository was originally designed to solve the problem of complex OpenFOAM case structure, and the solution was to re-present the original cases using the common configuration file format YAML. Later, since there is a corresponding package for the YAML format in Python, I wrote this Python interface package for OpenFOAM, and then I added progress bars to most OpenFOAM solvers by analyzing log files in real time. Although there are still many details to be specified in this repository, its function of generating cases and calling solvers is ready for preliminary use, for example, I used this package to generate cases in batch in my own project. In the future I would like to integrate the post-processing steps into this interface package as well.

(back to top)

Getting Started

This project currently uses Poetry to manage Python dependencies. I've heard good things about PDM so far, and may provide PDM support subsequently.

Installation

pip3 install ifoam[full]

Demo

Save the following demo code as a separate file (e.g. demo.py).

from foam import Foam

foam = Foam.from_demo('cavity')
foam['foam']['system', 'controlDict', 'endTime'] = 1.0
foam.save('cavity')
foam.cmd.all_run()

Running the demo code in the virtual environment results in the following output.

$ python demo.py

Foam.from_file('.../of.yaml/foam/demo/7/cavity.yaml', warn=False)
Running blockMesh on .../of.yaml/cavity using 1 processes if in parallel
Running icoFoam on .../of.yaml/cavity using 1 processes if in parallel
100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1.0/1.0 [00:02<00:00,  2.24s/it]

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repository and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GPL-3.0 License. See LICENSE.txt for more information.

(back to top)

Contact

Iydon Liang - @iydon - liangiydon_AT_gmail.com

(back to top)

of.yaml's People

Contributors

iydon avatar vianlee avatar yue-qiang 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.