Skip to main content

Contributors Forks Stargazers Issues GPL-3.0 License


Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. 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)

Built With

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

This project currently uses Poetry to manage Python dependencies. I've heard good things about PDM so far, and may provide PDM support subsequently. If Poetry is not installed, you can refer to official installation guide.

Installation

  1. Clone the repository
    git clone https://github.com/iydon/of.yaml.git
    
  2. Install Python dependencies
    poetry install --extras full
    
  3. Activate the virtual environment
    poetry shell
    
  4. (Optional) Convert Python package into a single file
    make standalone
    

(back to top)

Usage

Demo

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

from foam import Foam

foam = Foam.from_file('tutorials/incompressible/simpleFoam/airFoil2D.yaml')
foam.save('airFoil2D')
foam.cmd.all_run()

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

$ poetry run python demo.py
Running simpleFoam on .../of.yaml/airFoil2D
 63%|██████████████████████████████████████▏                      | 313.0/500.0 [00:06<00:04, 46.66it/s]

Tutorials

The following table shows the OpenFOAM cases that have been converted to YAML format. You can find the corresponding rules by comparing the YAML format with its original format, and I don't have the time or interest to organize the corresponding documentation for the time being.

The existing OpenFOAM tutorials in YAML format
YAML OpenFOAM Version Solver
airFoil2D.yaml airFoil2D 7 incompressible/simpleFoam
beamEndLoad.yaml beamEndLoad 7 stressAnalysis/solidEquilibriumDisplacementFoam
boxTurb16.yaml boxTurb16 7 DNS/dnsFoam
cylinder.yaml cylinder 7 basic/potentialFoam
damBreak.yaml damBreak 7 multiphase/interMixingFoam
damBreak4phase.yaml damBreak4phase 7 multiphase/multiphaseInterFoam
damBreak4phaseFine.yaml damBreak4phaseFine 7 multiphase/multiphaseInterFoam
damBreakWithObstacle.yaml damBreakWithObstacle 7 multiphase/interFoam
DTCHull.yaml DTCHull 7 multiphase/interFoam
elbow.yaml elbow 7 incompressible/icoFoam
europeanCall.yaml europeanCall 7 financial/financialFoam
fileHandler.yaml fileHandler 7 lagrangian/icoUncoupledKinematicParcelFoam
flange.yaml flange 7 basic/laplacianFoam
mixerVessel2D.yaml mixerVessel2D 7 multiphase/multiphaseInterFoam
nozzleFlow2D.yaml nozzleFlow2D 7 multiphase/interFoam
pipeCyclic.yaml pipeCyclic 7 incompressible/simpleFoam
pitzDaily.yaml pitzDaily 7 basic/potentialFoam
pitzDaily.yaml pitzDaily 7 basic/scalarTransportFoam
plateHole.yaml plateHole 7 stressAnalysis/solidDisplacementFoam
sloshingTank3D6DoF.yaml sloshingTank3D6DoF 7 multiphase/interFoam
propeller.yaml propeller 7 multiphase/interPhaseChangeFoam
mixerVesselAMI.yaml mixerVesselAMI 7 multiphase/interFoam
sloshingTank2D.yaml sloshingTank2D 7 multiphase/compressibleInterFoam
damBreak4phase.yaml damBreak4phase 7 multiphase/compressibleMultiphaseInterFoam
flamePropagationWithObstacles.yaml flamePropagationWithObstacles 7 combustion/PDRFoam
kivaTest.yaml kivaTest 7 combustion/XiEngineFoam
moriyoshiHomogeneous.yaml moriyoshiHomogeneous 7 combustion/XiFoam
throttle.yaml throttle 7 multiphase/cavitatingFoam
throttle3D.yaml throttle3D 7 multiphase/cavitatingFoam
throttle.yaml throttle 7 multiphase/cavitatingFoam

Task List

The following is a task list to convert OpenFOAM-7 to the corresponding YAML format. The corresponding rules for conversion are not currently organized because some of them are still unstable. I will first try to convert as many tutorials as possible, and then organize the rules afterwards.

Conversion task list
  • DNS
    • dnsFoam
      • boxTurb16
  • IO
    • fileHandler
  • basic
    • laplacianFoam
      • flange
    • potentialFoam
      • cylinder
      • pitzDaily
    • scalarTransportFoam
      • pitzDaily
  • combustion
    • PDRFoam
      • flamePropagationWithObstacles
    • XiEngineFoam
      • kivaTest
    • XiFoam
      • RAS
        • moriyoshiHomogeneous
    • chemFoam
      • gri
      • h2
      • ic8h18
      • ic8h18_TDAC
      • nc7h16
    • coldEngineFoam
      • freePiston
    • fireFoam
      • LES
        • flameSpreadWaterSuppressionPanel
        • oppositeBurningPanels
        • smallPoolFire2D
        • smallPoolFire3D
    • reactingFoam
      • RAS
        • DLR_A_LTS
        • SandiaD_LTS
        • membrane
      • laminar
        • counterFlowFlame2D
        • counterFlowFlame2DLTS
        • counterFlowFlame2DLTS_GRI_TDAC
        • counterFlowFlame2D_GRI
        • counterFlowFlame2D_GRI_TDAC
  • compressible
    • rhoCentralFoam
      • LadenburgJet60psi
      • biconic25-55Run35
      • forwardStep
      • movingCone
      • obliqueShock
      • shockTube
      • wedge15Ma5
    • rhoPimpleFoam
      • LES
        • pitzDaily
      • RAS
        • aerofoilNACA0012
        • angledDuct
        • angledDuctLTS
        • annularThermalMixer
        • cavity
        • mixerVessel2D
        • nacaAirfoil
        • prism
        • squareBendLiq
      • laminar
        • blockedChannel
        • decompressionTank
        • forwardStep
        • helmholtzResonance
        • shockTube
    • rhoPorousSimpleFoam
      • angledDuctExplicit
      • angledDuctImplicit
    • rhoSimpleFoam
      • aerofoilNACA0012
      • angledDuctExplicitFixedCoeff
      • squareBend
      • squareBendLiq
  • discreteMethods
    • dsmcFoam
      • freeSpacePeriodic
      • freeSpaceStream
      • supersonicCorner
      • wedge15Ma5
    • molecularDynamics
      • mdEquilibrationFoam
        • periodicCubeArgon
        • periodicCubeWater
      • mdFoam
        • nanoNozzle
  • electromagnetics
    • electrostaticFoam
      • chargedWire
    • mhdFoam
      • hartmann
  • financial
    • financialFoam
      • europeanCall
  • heatTransfer
    • buoyantPimpleFoam
      • BernardCells
      • hotRoom
      • hotRoomBoussinesq
    • buoyantSimpleFoam
      • buoyantCavity
      • circuitBoardCooling
      • externalCoupledCavity
      • hotRadiationRoom
      • hotRadiationRoomFvDOM
      • hotRoomBoussinesq
      • iglooWithFridges
    • chtMultiRegionFoam
      • coolingSphere
      • heatExchanger
      • heatedDuct
      • reverseBurner
      • shellAndTubeHeatExchanger
  • incompressible
    • SRFPimpleFoam
      • rotor2D
    • SRFSimpleFoam
      • mixer
    • adjointShapeOptimizationFoam
      • pitzDaily
    • boundaryFoam
      • boundaryLaunderSharma
      • boundaryWallFunctions
      • boundaryWallFunctionsProfile
    • icoFoam
      • cavity
        • cavity
        • cavityClipped
        • cavityGrade
      • elbow
    • nonNewtonianIcoFoam
      • offsetCylinder
    • pimpleFoam
      • LES
        • channel395
      • RAS
        • TJunction
        • TJunctionFan
        • elipsekkLOmega
        • impeller
        • oscillatingInletACMI2D
        • pitzDaily
        • pitzDailyLTS
        • propeller
        • wingMotion
      • laminar
        • blockedChannel
        • mixerVesselAMI2D
        • movingCone
        • offsetCylinder
        • planarContraction
        • planarCouette
        • planarPoiseuille
    • pisoFoam
      • LES
        • motorBike
        • pitzDaily
        • pitzDailyMapped
      • RAS
        • cavity
        • cavityCoupledU
      • laminar
        • porousBlockage
    • porousSimpleFoam
      • angledDuctExplicit
      • angledDuctImplicit
      • straightDuctImplicit
    • shallowWaterFoam
      • squareBump
    • simpleFoam
      • T3A
      • airFoil2D
      • mixerVessel2D
      • motorBike
      • pipeCyclic
      • pitzDaily
      • pitzDailyExptInlet
      • rotorDisk
      • turbineSiting
      • windAroundBuildings
  • lagrangian
    • DPMFoam
      • Goldschmidt
    • MPPICFoam
      • Goldschmidt
      • column
      • cyclone
      • injectionChannel
    • coalChemistryFoam
      • simplifiedSiwek
    • icoUncoupledKinematicParcelFoam
      • hopper
        • hopperEmptying
        • hopperInitialState
      • mixerVesselAMI2D
    • reactingParcelFoam
      • counterFlowFlame2DLTS
      • cylinder
      • filter
      • hotBoxes
      • parcelInBox
      • rivuletPanel
      • splashPanel
      • verticalChannel
      • verticalChannelLTS
    • simpleReactingParcelFoam
      • verticalChannel
    • sprayFoam
      • aachenBomb
  • mesh
    • blockMesh
      • pipe
      • sphere
      • sphere7
      • sphere7ProjectedEdges
    • foamyHexMesh
      • blob
      • flange
      • mixerVessel
      • simpleShapes
      • straightDuctImplicit → ../../incompressible/porousSimpleFoam/straightDuctImplicit
    • foamyQuadMesh
      • jaggedBoundary
      • square
    • moveDynamicMesh
      • SnakeRiverCanyon
    • refineMesh
      • refineFieldDirs
    • snappyHexMesh
      • flange
      • iglooWithFridges → ../../heatTransfer/buoyantSimpleFoam/iglooWithFridges
      • motorBike → ../../incompressible/simpleFoam/motorBike
  • multiphase
    • cavitatingFoam
      • LES
        • throttle
        • throttle3D
      • RAS
        • throttle
    • compressibleInterFoam
      • laminar
        • climbingRod
        • depthCharge2D
        • depthCharge3D
        • sloshingTank2D
    • compressibleMultiphaseInterFoam
      • laminar
        • damBreak4phase
    • driftFluxFoam
      • RAS
        • dahl
        • mixerVessel2D
        • tank3D
    • interFoam
      • LES
        • nozzleFlow2D
      • RAS
        • DTCHull
        • DTCHullMoving
        • DTCHullWave
        • angledDuct
        • damBreak
        • damBreakPorousBaffle
        • floatingObject
        • mixerVesselAMI
        • waterChannel
        • weirOverflow
      • laminar
        • capillaryRise
        • damBreak
        • damBreakWithObstacle
        • mixerVessel2D
        • sloshingCylinder
        • sloshingTank2D
        • sloshingTank2D3DoF
        • sloshingTank3D
        • sloshingTank3D3DoF
        • sloshingTank3D6DoF
        • testTubeMixer
        • wave
    • interMixingFoam
      • laminar
        • damBreak
    • interPhaseChangeFoam
      • cavitatingBullet
      • propeller
    • multiphaseEulerFoam
      • bubbleColumn
      • damBreak4phase
      • damBreak4phaseFine
      • mixerVessel2D
    • multiphaseInterFoam
      • laminar
        • damBreak4phase
        • damBreak4phaseFine
        • mixerVessel2D
    • potentialFreeSurfaceFoam
      • movingOscillatingBox
      • oscillatingBox
    • reactingMultiphaseEulerFoam
      • RAS
        • wallBoiling1D_2phase
        • wallBoiling1D_3phase
      • laminar
        • bed
        • bubbleColumn
        • bubbleColumnFixedPolydisperse
        • bubbleColumnPolydisperse
        • mixerVessel2D
        • trickleBed
    • reactingTwoPhaseEulerFoam
      • LES
        • bubbleColumn
      • RAS
        • LBend
        • bubbleColumn
        • bubbleColumnEvaporatingReacting
        • bubbleColumnPolydisperse
        • fluidisedBed
        • wallBoiling
        • wallBoiling1D
        • wallBoilingIATE
        • wallBoilingPolyDisperse
      • laminar
        • bubbleColumn
        • bubbleColumnEvaporating
        • bubbleColumnEvaporatingDissolving
        • bubbleColumnIATE
        • fluidisedBed
        • injection
        • mixerVessel2D
        • steamInjection
    • twoLiquidMixingFoam
      • lockExchange
    • twoPhaseEulerFoam
      • LES
        • bubbleColumn
      • RAS
        • bubbleColumn
        • fluidisedBed
      • laminar
        • bubbleColumn
        • bubbleColumnIATE
        • fluidisedBed
        • injection
        • mixerVessel2D
  • resources
    • geometry
  • stressAnalysis
    • solidDisplacementFoam
      • plateHole
    • solidEquilibriumDisplacementFoam
      • beamEndLoad

(back to top)

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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ifoam-0.11.1.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ifoam-0.11.1-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

Details for the file ifoam-0.11.1.tar.gz.

File metadata

  • Download URL: ifoam-0.11.1.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.3 Windows/10

File hashes

Hashes for ifoam-0.11.1.tar.gz
Algorithm Hash digest
SHA256 c52216c5ffd78eed03e892b38f8b16d1188519eb2e98b60124c5cef19bb691e8
MD5 b22ecf04489d29146e45870746c0b00d
BLAKE2b-256 df6e3dcedbaf15c5444c355866dde8c1b230086ec05b52e62723e6a4e581f123

See more details on using hashes here.

File details

Details for the file ifoam-0.11.1-py3-none-any.whl.

File metadata

  • Download URL: ifoam-0.11.1-py3-none-any.whl
  • Upload date:
  • Size: 50.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.3 Windows/10

File hashes

Hashes for ifoam-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 579698533ad9cf4a2a4a34e22bc0a6d8b32075b7069461df1a9cbdac48634e64
MD5 f9d58695a79b15a3e4cc45000156bbb6
BLAKE2b-256 45d81c0e0701085b34164b93f4e0c51ddd5d5d757b1c02322f1f1b7e93f1c0d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page