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:
--dimension
or-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 are1
and2
. Default is2
.--polynomial-degree
or-pd
: Degree of the polynomial to be generated. Default is2
. To prevent negative flow velocities, we always use even degrees.--shape
or-s
: Shape of the inlet. Supported shapes arerectangle
andcircle
. Default is rectangle.--flow-rate
or-fr
: Volumetric flow rate to be imposed at the inlet. Default is1
.--center
or-c
: Coordinates of the center of the inlet. Default is0. 0.
.--length
or-l
: Length associated to the inlet shape. If the shape is a rectangle, usea,b
, wherea
is the length in the x direction andb
is 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-digits
or-n
: Number of significant digits to be used in the output polynomial. Default is5
.plot
or-p
: Used for plotting the generated profile obtained by the script. IfTrue
plots of velocity as a function ofx
at centery`
and velocity as a function ofy`
at centerx
are 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:
