Inlet profile generator#
This tool is a simple Python script that generates a polynomial function to use as inlet boundary condition for the flow.
The output of the script is a polynomial function that can be used in the Function expression parameter of a inlet boundary condition for the velocity.
It can be found in the /contrib/utilities/inlet_profile_generator folder of the Lethe repository.
To run the script you just need to have SymPy installed in your Python environment.
The script has the following arguments:
--dimensionor-d: Dimensions of the profile. This variable stands for the dimensions of the boundary. For instance, in a 2D simulation, your boundary face is 1D, so this argument should be 1. Supported dimensions are1and2. Default is2.--polynomial-degreeor-pd: Degree of the polynomial to be generated. Default is2. To prevent negative flow velocities, we always use even degrees.--shapeor-s: Shape of the inlet. Supported shapes arerectangleandcircle. Default is rectangle.--flow-rateor-fr: Volumetric flow rate to be imposed at the inlet. Default is1.--centeror-c: Coordinates of the center of the inlet. Default is0. 0..--lengthor-l: Length associated to the inlet shape. If the shape is a rectangle, usea,b, whereais the length in the x direction andbis the length in the y direction. If the shape is a circle, give the diameter of. Default is1. 1.for rectangle and1.for the circle.--number-significant-digitsor-n: Number of significant digits to be used in the output polynomial. Default is5.plotor-p: Used for plotting the generated profile obtained by the script. IfTrueplots of velocity as a function ofxat centery`and velocity as a function ofy`at centerxare shown. Default isFalse.
Running the script is as simple as:
The output of this command is:
=== Inlet velocity profile u(x,y) (SymPy expression) ===
(-192.0*x^4 - 384.0*x^2*y^2 - 192.0*y^4 + 12.0)/pi
Plotting centerline u(r) with SymPy...
With the following plot: