fluidsimfoam.foam_input_files#
OpenFOAM input files
AST and parser
Abstract Syntax Trees for OpenFOAM input files |
|
Internal machinery to generate the OpenFOAM input files |
|
Parser for OpenFOAM input files |
|
Format OpenFOAM input files |
Helper to create input files
Helper to create blockMeshDict files |
|
Helper to create controlDict files |
|
Helper to create field files |
|
Helper to create fvSchemes files |
|
Helper to create constant files |
|
Helper to create fvOptions files |
|
Helper to create decomposeParDict files |
|
Utilities |
Functions
|
Parse the header ("FoamFile" entry) of an OpenFOAM file |
|
Read the header ("FoamFile" entry) of an OpenFOAM file |
Classes
Abstract class for "Helper" objects |
- class fluidsimfoam.foam_input_files.FoamInputFile(info, children=None, header=None, comments=None)[source]#
- class fluidsimfoam.foam_input_files.List(iterable=None, name=None, dtype=None)[source]#
Represents an OpenFoam list
- class fluidsimfoam.foam_input_files.BlockMeshDict[source]#
-
- add_vertex(x, y=None, z=None, name=None)[source]#
add vertex by coordinate and uniq name x y z is coordinates of vertex name is uniq name to refer the vertex returns Vertex object whici is added.
- reduce_vertex(name1, *names)[source]#
treat name1, name2, … as same point.
name2.alias, name3.alias, … are merged with name1.alias the key name2, name3, … in self.vertices are kept and mapped to same Vertex instance as name1
- add_hexblock(vnames, nx_ny_nz, name=None, grading=<fluidsimfoam.foam_input_files.blockmesh.grading.SimpleGrading object>)[source]#
- add_hexblock_from_2d(vnames, nx_ny_nz, name=None, grading=<fluidsimfoam.foam_input_files.blockmesh.grading.SimpleGrading object>, suffix_zm='', suffix_zp='_dz')[source]#
- add_cyclic_boundaries(name0, name1, faces0, faces1)[source]#
Add 2 cyclic boundaries
Example
2 cyclic boundaries can be created as follow:
add_cyclic_boundaries("outlet", "inlet", b0.face("e"), b0.face("w"))
- assign_vertexid(sort=True)[source]#
create list of Vertex which are referred by blocks only.
sort vertex according to (x, y, z)
assign sequence number for each Vertex
sorted list is saved as self._vertices_in_blockmesh
- format_vertices_section()[source]#
format vertices section. assign_vertexid() should be called before this method, because self._vertices_in_blockmesh should be available and members of self._vertices_in_blockmesh should have valid index.
- format_blocks_section()[source]#
format blocks section. assign_vertexid() should be called before this method, because vertices refered by blocks should have valid index.
- format_edges_section()[source]#
format edges section. assign_vertexid() should be called before this method, because vertices refered by blocks should have valid index.
- format_boundary_section()[source]#
format boundary section. assign_vertexid() should be called before this method, because vertices refered by faces should have valid index.
- format(header='/*--------------------------------*- C++ -*----------------------------------*\\\n| ========= | |\n| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n| \\\\ / O peration | Version: v2206 |\n| \\\\ / A nd | Website: www.openfoam.com |\n| \\\\/ M anipulation | |\n\\*---------------------------------------------------------------------------*/', sort_vortices=True)[source]#
- class fluidsimfoam.foam_input_files.VolScalarField(name, dimension, tree=None, values=None)[source]#
- class fluidsimfoam.foam_input_files.VolVectorField(name, dimension, tree=None, values=None)[source]#
- class fluidsimfoam.foam_input_files.FvSchemesHelper(ddt=None, grad=None, div=None, laplacian=None, interpolation=None, sn_grad=None)[source]#
- keys = ['ddt', 'grad', 'div', 'laplacian', 'interpolation', 'snGrad']#
- class fluidsimfoam.foam_input_files.ConstantFileHelper(file_name: str, default: dict, default_dimension: str = False, dimensions: Optional[dict] = None, comments: Optional[dict] = None, doc: Optional[str] = None, cls: str = 'dictionary', dimension=None)[source]#
- class fluidsimfoam.foam_input_files.BlockMeshDictRectilinear(lx, ly, lz, nx, ny, nz, scale)[source]#
- class fluidsimfoam.foam_input_files.FvOptionsHelper[source]#
- class fluidsimfoam.foam_input_files.DecomposeParDictHelper(nsubdoms=1, method='scotch', key_in_params='parallel')[source]#