Preprocessing

Acoustic Element

class pulse.preprocessing.acoustic_element.AcousticElement(first_node, last_node, index, **kwargs)[source]

An acoustic element. This class creates an acoustic element from input data.

Parameters
  • first_node (Node object) – Fist node of element.

  • last_node (Node object) – Last node of element.

  • index (int) – Element index.

  • element_type (str, ['dampingless', 'hysteretic', 'wide-duct', 'LRF fluid equivalent', 'LRF full'], optional) – Element type Default is ‘dampingless’.

  • hysteretic_damping (float, optional) – Hysteretic damping coefficient Default is ‘None’.

  • material (Material object, optional) – Element structural material. Default is ‘None’.

  • fluid (Fluid object, optional) – Element acoustic fluid. Default is ‘None’.

  • cross_section (CrossSection object, optional) – Element cross section. Default is ‘None’.

  • loaded_pressure (array, optional) – Acoustic pressure on the nodes. Default is [0, 0].

  • acoustic_length_correction (int, [0, 1, 2], optional) – Acoustic length correction due to acoustic discontinuities. The prescription is done through the following labeling: None: disable 0 : expansion 1 : side_branch 2 : loop Default is None.

_fetm_damping_models(frequencies)[source]

This method returns wavenumber and fluid impedance for the FETM 1D theory according to the element’s damping model (element type). The damping models compatible with FETM 1D are Dampingless, Hysteretic, Wide-duct, and LRF fluid equivalent.

Parameters

frequencies (array) – Frequencies of analysis in Hz.

Returns

  • kappa (complex-array) – Complex wavenumber. This array have the same structure of the frequencies array.

  • z (complex-array) – Complex impedance. This array have the same structure of the frequencies array.

fem_1d_matrix(length_correction=0)[source]

This method returns the FEM acoustic 1D elementary matrices. The method allows to include the length correction due to acoustic discontinuities (loop, expansion, side branch). The FEM is not compatible with any damping model.

Obs.: In the OpenPulse, this formulation is only used to evaluate the acoustic modal analysis.

Parameters

length_correction (float, optional) – Element length correction to be added into the element length.

Returns

  • Ke (2D array) – Element acoustic stiffness matrix.

  • Me (2D array) – Element acoustic inertia matrix.

fetm_1d_matrix(frequencies, length_correction=0)[source]

This method returns the FETM 1D element’s admittance matrix for each frequency of analysis. The method allows to include the length correction due to acoustic discontinuities (loop, expansion, side branch). The damping models compatible with FETM 1D are Dampingless, Hysteretic, Wide-duct, and LRF fluid equivalent.

Parameters
  • frequencies (array) – Frequencies of analysis in Hertz.

  • length_correction (float, optional) – Element length correction to be added into the element length.

Returns

Element’s admittance matrix. Each row of the output array is an element’s admittance matrix corresponding to a frequency of analysis.

Return type

2D array

property global_dof

This method returns a list of the element’s global degree of freedom.

Returns

Indexes of the global degree of freedom.

Return type

list

global_matrix_indexes()[source]

This method returns the rows’ and columns’ indexes that place the element’s matrices in the global matrices. The created lists are such that the method is useful to generate sparse matrices.

Returns

  • rows (list) – List of indexes of the global matrices’ rows where the element’s matrices have to be added.

  • cols (list) – List of indexes of the global matrices’ columns where the element’s matrices have to be added.

property impedance

This method returns the element’s acoustic impedance based on its fluid and cross section.

Returns

The element impedance.

Return type

float

property length

This method returns the element’s length.

Returns

Element length.

Return type

float

lrf_thermoviscous_matrix(frequencies, length_correction=0)[source]

This method returns the LRF thermoviscous 1D elementary admittance matrix for each frequency of analysis. The method allows to include the length correction due to acoustic discontinuities (loop, expansion, side branch).

Parameters
  • frequencies (array) – Frequencies of analysis in Hertz.

  • length_correction (float, optional) – Element length correction to be added into the element length.

Returns

Elementary admittance matrix. Each row of the output array is an element admittance matrix corresponding to a frequency of analysis.

Return type

2D array

matrix(frequencies, length_correction=0)[source]

This method returns the element’s admittance matrix for each frequency of analysis according to the element type. The method allows to include the length correction due to acoustic discontinuities (loop, expansion, side branch).

Parameters
  • frequencies (array) – Frequencies of analysis in Hz.

  • length_correction (float, optional) – Element length correction to be added into the element length.

Returns

Element’s admittance matrix. Each row of the output array is an element’s admittance matrix corresponding to a frequency of analysis.

Return type

2D array

property orientation

This method returns element’s axial orientation in the global coordinate system.

Returns

x-axis vector.

Return type

array

radiation_impedance(kappa_complex, impedance_complex)[source]

This method update the radiation impedance attributed to the element nodes according to the anechoic, flanged, and unflanged prescription.

Parameters
  • kappa (complex-array) – Complex wavenumber.

  • z (complex-array) – Complex impedance.

speed_of_sound_corrected()[source]

This method returns the corrected speed of sound due to the mechanical compliance of the pipe wall.

Returns

Speed of sound in the element.

Return type

float

References

pulse.preprocessing.acoustic_element.flanged_termination_impedance(kappa_complex, pipe_radius, impedance_complex)[source]

Auxiliary function to update the radiation impedance attributed to the element nodes according to the flanged prescription.

Parameters
  • kappa_complex (complex-array) – Complex wavenumber.

  • pipe_radius (float) – Pipe radius.

  • impedance_complex (complex-array) – Complex impedance.

Returns

Flanged termination impedance. The array has the same length as kappa_complex parameter.

Return type

array

pulse.preprocessing.acoustic_element.j2j0(z)[source]

Auxiliary function to compute the ratio between the Bessel functions J2 and J0. When the imaginary part of input z reaches 700, the following syntonic approximation is used:

j2/j0 = -1, when z --> \infty.

Parameters

z (array) –

pulse.preprocessing.acoustic_element.poly_function(x)[source]

This function compute a auxiliary polynomial to define the unflanged radiation impedance.

Parameters

array – Independent variable.

Returns

Polynomial output.

Return type

array

pulse.preprocessing.acoustic_element.unflanged_termination_impedance(kappa_complex, pipe_radius, impedance_complex)[source]

Auxiliary function to update the radiation impedance attributed to the element nodes according to the unflanged prescription.

Parameters
  • kappa_complex (complex-array) – Complex wavenumber.

  • pipe_radius (float) – Pipe radius.

  • impedance_complex (complex-array) – Complex system impedance.

Returns

Unflanged pipe termination impedance. The array has the same length as kappa_complex parameter.

Return type

array

Structural Element

class pulse.preprocessing.structural_element.StructuralElement(first_node, last_node, index, **kwargs)[source]

A structural element. This class creates a structural element from input data.

Parameters
  • first_node (Node object) – Fist node of element.

  • last_node (Node object) – Last node of element.

  • index (int) – Element index.

  • element_type (str, ['pipe_1', 'pipe_2', 'beam_1'], optional) – Element type Default is ‘pipe_1’.

  • material (Material object, optional) – Element structural material. Default is ‘None’.

  • fluid (Fluid object, optional) – Element acoustic fluid. Default is ‘None’.

  • cross_section (CrossSection object, optional) – Element cross section. Default is ‘None’.

  • loaded_forces (array, optional) – Structural forces and moments on the nodes. Default is zeros(12).

_element_rotation_matrix()[source]

This method returns the transformation matrix that perform a rotation from the element’s local coordinate system to the global coordinate system.

Returns

Rotation matrix

Return type

array

force_vector()[source]

This method returns the element load vector in the local coordinate system. The loads are forces and moments according to the degree of freedom.

Returns

force – Load in the local coordinate system.

Return type

array

Raises

TypeError – Only pipe_1 and pipe_2 element types are allowed.

force_vector_acoustic_gcs(frequencies, pressure_avg, pressure_external)[source]

This method returns the element load vector due to the internal acoustic pressure field in the global coordinate system. The loads are forces and moments according to the degree of freedom.

Parameters
  • frequencies (array) – Frequencies of analysis in Hertz.

  • pressure_avg (array) – The average between the pressure at the first node and last node of the element.

Returns

force – Load vector in the global coordinate system.

Return type

array

force_vector_gcs()[source]

This method returns the element force vector in the global coordinate system.

Returns

Force vector in the global coordinate system.

Return type

array

get_local_coordinate_system_info()[source]

This method returns the coordinates of the element center and its local coordinate system.

Returns

  • center_element_coordinates (array) – Coordinates of element center.

  • directional_vectors (array) – Element local coordinate system.

get_shear_coefficient(section_info, poisson)[source]

This method returns the shear coefficient according to the beam cross section. This coefficient is traditionally introduced in the Timoshenko beam theory.

Parameters
  • section_info – Beam cross section data.

  • poisson (float) – Material Poisson’s ratio.

Returns

shear_coefficient – shear coefficient

Return type

float

property global_dof

This method returns the element global degrees of freedom. The 3D Timoshenko beam theory implemented takes into account the three node’s translations and the three node’s rotations.

Returns

Element global degrees of freedom.

Return type

list

global_matrix_indexes()[source]

This method returns the indexes of the rows and columns that place the element matrices into the global matrices according to the element global degrees of freedom.

Returns

  • rows (array) – Indexes of the rows. It’s a matrix with dimension 12 by 12 constant through the rows.

  • cols (array) – Indexes of the columns. It’s a matrix with dimension 12 by 12 constant through the columns.

property length

This method returns the element length.

Returns

Element length.

Return type

float

mass_matrix_beam()[source]

This method returns the beam element mass matrix according to the 3D Timoshenko beam theory in the local coordinate system. This formulation is suitable for any beam cross section data.

Returns

mass – Beam element mass matrix in the local coordinate system.

Return type

array

See also

mass_matrix_pipes

Pipe element mass matrix in the local coordinate system.

mass_matrix_gcs()[source]

This method returns the element mass matrix according to the 3D Timoshenko beam theory in the global coordinate system.

Returns

mass – Element mass matrix in the global coordinate system.

Return type

array

See also

matrices_gcs

Element stiffness and mass matrices in the global coordinate system.

stiffness_matrix_gcs

Element stiffness matrix in the global coordinate system.

mass_matrix_pipes()[source]

This method returns the pipe element mass matrix according to the 3D Timoshenko beam theory in the local coordinate system. This formulation is optimized for pipe cross section data.

Returns

mass – Pipe element mass matrix in the local coordinate system.

Return type

array

See also

mass_matrix_beam

Beam element mass matrix in the local coordinate system.

matrices_gcs()[source]

This method returns the element stiffness and mass matrices according to the 3D Timoshenko beam theory in the global coordinate system.

Returns

  • stiffness (array) – Element stiffness matrix in the global coordinate system.

  • mass (array) – Element mass matrix in the global coordinate system.

See also

stiffness_matrix_gcs

Element stiffness matrix in the global coordinate system.

mass_matrix_gcs

Element mass matrix in the global coordinate system.

stiffness_matrix_beam()[source]

This method returns the beam element stiffness matrix according to the 3D Timoshenko beam theory in the local coordinate system. This formulation is suitable for any beam cross section data.

Returns

stiffness – Beam element stiffness matrix in the local coordinate system.

Return type

array

See also

stiffness_matrix_pipes

Pipe element stiffness matrix in the local coordinate system.

stiffness_matrix_gcs()[source]

This method returns the element stiffness matrix according to the 3D Timoshenko beam theory in the global coordinate system.

Returns

stiffness – Element stiffness matrix in the global coordinate system.

Return type

array

See also

matrices_gcs

Element stiffness and mass matrices in the global coordinate system.

mass_matrix_gcs

Element mass matrix in the global coordinate system.

stiffness_matrix_pipes

Pipe element stiffness matrix in the local coordinate system.

stiffness_matrix_beam

Beam element stiffness matrix in the local coordinate system.

stiffness_matrix_pipes()[source]

This method returns the pipe element stiffness matrix according to the 3D Timoshenko beam theory in the local coordinate system. This formulation is optimized for pipe cross section data.

Returns

stiffness – Pipe element stiffness matrix in the local coordinate system.

Return type

array

See also

stiffness_matrix_beam

Beam element stiffness matrix in the local coordinate system.

stress_stiffening()[source]

This method returns description

Returns

S – Load vector in the global coordinate system.

Return type

array

pulse.preprocessing.structural_element.gauss_quadrature(integration_points)[source]

This method returns the Gauss quadrature data.

Parameters

integration_points (int) – Number of integration points.

Returns

  • points (array) – Integration points in the normalized domain [-1,1].

  • weigths (array) – Weigths of the respective integration points in the sum approximation.

Raises

TypeError – Only 1, 2, and 3 integration points are supported.

pulse.preprocessing.structural_element.shape_function(ksi)[source]

This function returns the one dimensional linear shape function and its derivative.

Parameters
  • in [-1 (float) – Dimensionless coordinate.

  • 1] – Dimensionless coordinate.

Returns

  • phi (array) – One dimensional linear shape function.

  • derivative_phi (array) – Shape function derivative.

pulse.preprocessing.structural_element.symmetrize(a)[source]

This function receives matrix and makes it symmetric.

Parameters

array – Matrix.

Returns

Symmetric matrix.

Return type

array

Cross Section

class pulse.preprocessing.cross_section.CrossSection(external_diameter, thickness, offset_y, offset_z, poisson_ratio=0, element_type='pipe_1', division_number=64, **kwargs)[source]

This class creates a tube Cross Section object from input data.

Parameters
  • external_diameter (float) – Tube external diameter.

  • thickness (float) – Tube wall thickness.

  • offset_y (float) – y coordinate of the tube eccentricity offset.

  • offset_z (float) – z coordinate of the tube eccentricity offset.

  • poisson_ratio (float, optional) – Poisson’s ration of the material attributed to the tube. Default is 0.

  • element_type (['pipe_1','pipe_2','beam_1'], optional) – Element type of the structural elements attributed to the tube. Default is ‘pipe_1’.

  • division_number ([8, 16, 32, 64, 128], optional) – Cross section division number. This number is directly associated with the number of elements used in the process of approximating the cross section shear properties. Default is 64.

  • insulation_thickness (float, optional) – Tube insolation thickness. Default is 0.

  • insulation_density (float, optional) – Tube insolation density. Default is 0.

  • additional_section_info (, optional) – Cross section additional infos. Default is None.

  • area (float, optional) – Cross section area. Only attributed if the cross section is not tubular. Default is 0.

  • Iyy (float, optional) – Cross section second moment of area with respect to the y direction. Only attributed if the cross section is not tubular. Default is 0.

  • Izz (float, optional) – Cross section second moment of area with respect to the z direction. Only attributed if the cross section is not tubular. Default is 0.

  • Iyz (float, optional) – Cross section second moment of area with respect to the yz plane. Only attributed if the cross section is not tubular. Default is 0.

  • shear_coefficient (float, optional) – Cross section shear coefficient. Only attributed if the cross section is not tubular. Default is 1.

_polar_moment_area()[source]

Cross section second polar moment of area [m**4].

property area_fluid

This method returns the tube internal cross section area, which corresponds to the acoustic area.

Returns

internal area.

Return type

float

property area_insulation

This method returns the insulation cross section area.

Returns

insulation cross section area.

Return type

float

area_properties(el_type)[source]

This method updates the tube cross area properties: area, first moment of area relative to y, first moment of area relative to z, second moment of area relative to y, second moment of area relative to z, second moment of area relative to yz, second moment of area relative to yz, second polar moment of area, and (y,z) centroid coordinate.

Parameters

el_type (['pipe_1','pipe_2','beam_1']) – Element type of the structural elements attributed to the tube. Default is None.

assembly_indexes()[source]

This method updates the assembly process rows and columns indexing.

getExternalDiameter()[source]

This method returns the tube cross section external diameter.

Returns

external diameter.

Return type

float

getExternalRadius()[source]

This method returns the tube cross section external radius.

Returns

external radius.

Return type

float

getInternalDiameter()[source]

This method returns the tube cross section internal diameter.

Returns

internal diameter.

Return type

float

getThickness()[source]

This method returns the tube cross section thickness.

Returns

thickness.

Return type

float

mesh_connectivity()[source]

This method returns the tube cross mesh connectivity formed by 9-node quadrilateral elements.

Returns

Tube cross mesh connectivity.

Return type

array

See also

mesh_coordinate

Tube cross mesh nodal coordinates.

mesh_coordinate()[source]

This method returns the tube cross mesh nodal coordinates formed by 9-node quadrilateral elements.

Returns

Tube cross mesh nodal coordinates.

Return type

array

See also

mesh_connectivity

Tube cross mesh connectivity.

offset_rotation(el_type='pipe_1')[source]

This method updates the tube cross section rotation due to the shear effects and eccentricity offset.

Parameters

el_type (['pipe_1','pipe_2','beam_1'], optional) – Element type of the structural elements attributed to the tube. Default is None.

preprocessing(el_type=None)[source]

This method returns the tube cross mesh nodal coordinates formed by 9-node quadrilateral elements.

Parameters

el_type (['pipe_1','pipe_2','beam_1'], optional) – Element type of the structural elements attributed to the tube. Default is None.

Returns

  • jac (array) – Jacobian matrix of each integration point. It’s a 3D matrix such that jac[p,:] is the Jacobian matrix of the p-th integration point (in-line 2x2 matrix).

  • inv_jac (array) – Inverse of the Jacobian matrix of each element. It’s a 3D matrix such that inv_jac[p,:] is the inverse of the Jacobian matrix of the p-th integration point (in-line 2x2 matrix).

  • dA (array) – Area differential of each integration point.

  • y (array) – y-coordinate in the global coordinate system of each integration point.

  • z (array) – z-coordinate in the global coordinate system of each integration point.

shear_properties(poisson_ratio=0, el_type='pipe_1')[source]

This method updates the tube cross shear properties: shear coefficients and (y,z) shear centroid coordinate.

Parameters
  • poisson_ratio (float, optional) – Poisson’s ration of the material attributed to the tube. Default is 0.

  • el_type (['pipe_1','pipe_2','beam_1'], optional) – Element type of the structural elements attributed to the tube. Default is None.

update_properties()[source]

This method updates all the tube cross section properties.

pulse.preprocessing.cross_section.gauss_quadrature2D()[source]

This method returns the Gauss quadrature data for 2D integration and two integration points.

Returns

  • points (array) – Integration points in the normalized domain [-1,1]x[-1,1].

  • weigths (array) – Weigths of the respective integration points in the sum approximation.

See also

get_all_shape_functions

Shape function and its derivative for all the integration points.

pulse.preprocessing.cross_section.get_all_shape_functions()[source]

This function returns the two dimensional quadratic shape function and its derivative (9-node quadrilateral element) for all Gauss quadrature 2D integration points in the dimensionless coordinate system (ksi,eta).

Returns

  • phi (array) – One dimensional linear shape function.

  • dphi (array) – Shape function derivative.

See also

shape_function

Shape function and its derivative for one point.

gauss_quadrature2D

Gauss quadrature data for 2D integration and two integration points.

pulse.preprocessing.cross_section.shape_function(ksi, eta)[source]

This function returns the two dimensional quadratic shape function and its derivative (9-node quadrilateral element) for one point in the dimensionless coordinate system (ksi,eta).

Parameters
  • ksi (float in [-1,1]) – Dimensionless x coordinate.

  • eta (float in [-1,1]) – Dimensionless y coordinate.

Returns

  • phi (array) – One dimensional linear shape function.

  • dphi (array) – Shape function derivative.

See also

get_all_shape_functions

Shape function and its derivative for all the integration points.

Entity

class pulse.preprocessing.entity.Entity(tag, **kwargs)[source]

A entity class. This class creates a entity object from input data.

Parameters

tag (int) – Entity tag name, which is displayed to the user in the UI.

getColor()[source]

This method returns entity color.

Returns

Entity color.

Return type

tuple

See also

getNormalizedColor

Normalized entity color.

getCrossSection()[source]

This method returns entity cross section.

Returns

Entity cross section.

Return type

CrossSection object

getElementType()[source]

This method returns entity structural element type.

Returns

structural element type.

Return type

int

getFluid()[source]

This method returns entity fluid.

Returns

Entity fluid.

Return type

Fluid object

getMaterial()[source]

This method returns entity material.

Returns

Entity material.

Return type

Material object

getNormalizedColor()[source]

This method returns normalized entity color.

Returns

Normalized entity color.

Return type

tuple

See also

getColor

Entity color.

get_elements()[source]

This method returns the list of elements that belong to the entity.

Returns

Elements that belong to the entity.

Return type

list

See also

insertEdge

Appends a element to the list of elements.

get_nodes()[source]

This method returns the list of nodes that belong to the entity.

Returns

Nodes that belong to the entity.

Return type

list

See also

insertNode

Appends a node to the list of nodes.

get_tag()[source]

This method returns entity tag.

Returns

Entity tag.

Return type

int

getcappedEnd()[source]

This method returns entity capped end configuration.

Returns

Capped end configuration.

Return type

boll

insertEdge(edge)[source]

This method appends an element to the list of elements that belong to the entity.

Parameters

edge (gmesh element) –

See also

get_elements

List of elements that belong to the entity.

insertNode(node)[source]

This method appends a node to the list of nodes that belong to the entity.

Parameters

node (Node object) –

See also

get_nodes

List of nodes that belong to the entity.

Fluid

class pulse.preprocessing.fluid.Fluid(name, density, speed_of_sound, **kwargs)[source]

A fluid class. This class creates a fluid object from fluid properties input data.

Parameters
  • name (str) – Text to be used as fluid’s name.

  • density (float) – Fluid density.

  • speed_of_sound (float) – Speed of the sound wave propagating in the fluid.

  • isentropic_exponent (float, optional) – Fluid isentropic exponent, also know as the heat capacity ratio, the adiabatic index, the ratio of specific heats, or Laplace’s coefficient. Default is None.

  • thermal_conductivity (float, optional) – Fluid thermal conductivity. Default is None.

  • specific_heat_Cp (float, optional) – Fluid specific heat capacity at constant pressure. Default is None.

  • dynamic_viscosity (float, optional) – Fluid dynamic viscosity. Default is None.

  • color (tuple, optional) – The color associated with the fluid. Entity objects with this fluid object attributed will be shown with this color in the UI. Default is None.

  • identifier (int, optional) – Fluid identifier displayed in the UI list of fluids. Default is -1.

property bulk_modulus

This method evaluates the fluid Bulk modulus.

Returns

Fluid Bulk modulus.

Return type

float

getColorRGB()[source]

This method returns the fluid color.

Returns

Fluid color.

Return type

tuple

getName()[source]

This method returns the fluid name.

Returns

Fluid name.

Return type

str

getNormalizedColorRGB()[source]

This method returns the fluid normalized color.

Returns

Fluid color.

Return type

tuple

property impedance

This method evaluates the fluid specific impedance.

Returns

Fluid specific impedance.

Return type

float

property kinematic_viscosity

This method evaluates the fluid kinematic viscosity.

Returns

Fluid kinematic viscosity.

Return type

float

property prandtl

This method evaluates the fluid Prandtl number.

Returns

Fluid Prandtl number.

Return type

float

property thermal_diffusivity

This method evaluates the fluid thermal diffusivity.

Returns

Fluid thermal diffusivity.

Return type

float

Material

class pulse.preprocessing.material.Material(name, density, **kwargs)[source]

A material class. This class creates a material object from material properties input data.

Parameters
  • name (str) – Text to be used as material’s name.

  • density (float) – Material density.

  • young_modulus (float, optional) – Material Young’s modulus. Default is None.

  • poisson_ratio (float, optional) – Material Poisson’s ratio. Default is None.

  • shear_modulus (float, optional) – Material shear modulus. Default is None.

  • color (tuple, optional) – The color associated with the material. Entity objects with this material object attributed will be shown with this color in the UI. Default is None.

  • identifier (int, optional) – Material identifier displayed in the UI list of materials. Default is -1.

_calculate_remaining_properties()[source]

This method evaluates the material property among Young’s modulus, Poisson’s ratio and shear modulus that was not attributed to the material.

Raises

TypeError – At least two arguments among Young’s modulus, Poisson’s ratio and shear modulus have to be attributed to the material.

getColorRGB()[source]

This method returns the material color.

Returns

Material color.

Return type

tuple

getName()[source]

This method returns the material name.

Returns

Mataerial name.

Return type

str

getNormalizedColorRGB()[source]

This method returns the material normalized color.

Returns

Material color.

Return type

tuple

property lambda_parameter

This method evaluates the Lamé’s first parameter lambda.

Returns

Lamé constant lambda.

Return type

float

See also

mu_parameter

Evaluate Lamé constant mu.

property mu_parameter

This method evaluates the Lamé’s second parameter mu.

Returns

Lamé constant mu.

Return type

float

See also

lambda_parameter

Evaluate Lamé constant lambda.

Mesh

class pulse.preprocessing.mesh.Mesh[source]

A mesh class. This class creates a acoustic and structural mesh object.

_create_acoustic_elements(indexes, connectivities, map_nodes, map_elements)[source]

This method generate the mesh acoustic elements.

Parameters
  • indexes (List) – Nodes global indexes.

  • connectivities (array) – Connectivity matrix that relates the elements and its nodes.

  • map_nodes (dict) – Dictionary maps global indexes to external indexes.

  • map_elements (dict) – Dictionary maps global element indexes.

_create_entities()[source]

This method generate the mesh entities, nodes, structural elements, acoustic elements and their connectivity.

_create_nodes(indexes, coords, map_nodes)[source]

This method generate the mesh nodes.

Parameters
  • indexes (List) – Nodes global indexes.

  • coords (array) – Nodes coordinates.

  • map_nodes (dict) – Dictionary maps global indexes to external indexes.

_create_structural_elements(indexes, connectivities, map_nodes, map_elements)[source]

This method generate the mesh structural elements.

Parameters
  • indexes (List) – Nodes global indexes.

  • connectivities (array) – Connectivity matrix that relates the elements and its nodes.

  • map_nodes (dict) – Dictionary maps global indexes to external indexes.

  • map_elements (dict) – Dictionary maps global element indexes.

_finalize_gmsh()[source]

This method finalize the mesher gmsh algorithm.

_initialize_gmsh(path)[source]

This method initializes mesher algorithm gmsh.

Parameters

str – CAD file path. ‘.igs’ is the only format file supported.

_load_neighbors()[source]

This method updates the structural elements neighbors dictionary. The dictionary’s keys and values are nodes objects.

_map_lines_to_elements(mesh_loaded=False)[source]

This method maps entities to elements.

Parameters

mesh_loaded (boll, optional.) – True if the mesh was already generated (internally or externally). False otherwise.

_order_global_indexes()[source]

This method updates the nodes global indexes numbering.

_process_beam_nodes_and_indexes()[source]

This method ?????.

Returns

Return type

boll

_reset_global_indexes()[source]

This method attributes None to global index of all mesh nodes.

_set_gmsh_options(element_size)[source]

This method sets the mesher algorithm configuration.

Parameters

float – Element size.

add_compressor_excitation(parameters)[source]

This method ???????

Parameters

??????

add_damper_to_node(nodes, values)[source]

This method attributes structural lumped damping (damper) to a list of nodes.

Parameters
  • nodes_id (list) – Nodes external indexes.

  • values (complex or array) – Lumped damping. Complex valued input corresponds to a constant damping with respect to the frequency. Array valued input corresponds to a variable damping with respect to the frequency.

This method ???????

Parameters
  • nodeID_1 (int) – Node 1 external index.

  • nodeID_2 (int) – Node 2 external index.

  • parameters – ???????.

  • _stiffness (boll, optional) – True if ???????. False otherwise. Default is False.

  • _damping (boll, optional) – True if ???????. False otherwise. Default is False.

add_mass_to_node(nodes, values)[source]

This method attributes structural lumped mass to a list of nodes.

Parameters
  • nodes_id (list) – Nodes external indexes.

  • values (complex or array) – Lumped mass. Complex valued input corresponds to a constant mass with respect to the frequency. Array valued input corresponds to a variable mass with respect to the frequency.

add_spring_to_node(nodes, values)[source]

This method attributes structural lumped stiffness (spring) to a list of nodes.

Parameters
  • nodes_id (list) – Nodes external indexes.

  • values (complex or array) – Lumped stiffness. Complex valued input corresponds to a constant stiffness with respect to the frequency. Array valued input corresponds to a variable stiffness with respect to the frequency.

check_fluid_and_cross_section_in_all_elements()[source]

This method checks if all acoustic elements have a fluid object and a cross section object attributed.

check_fluid_inputs_in_all_elements()[source]

This method checks if each acoustic element has the necessary fluid data to evaluate the analysis according to its element type.

check_material_all_elements()[source]

This method checks if all structural elements have a material object attributed.

check_material_and_cross_section_in_all_elements()[source]

This method checks if all structural elements have a material object and a cross section object attributed.

check_nodes_attributes(acoustic=False, structural=False, coupled=False)[source]

This method checks if there is the necessary nodal input data to evaluate the analysis according to its type.

Parameters
  • acoustic (boll, optional) – True if a acoustic analysis will be performed. False otherwise. Default is False.

  • structural (boll, optional) – True if a structural analysis will be performed. False otherwise. Default is False.

  • coupled (boll, optional) – True if a coupled analysis will be performed. False otherwise. Default is False.

check_poisson_all_elements()[source]

This method checks if all structural elements have a Poisson ratio attributed.

enable_fluid_mass_adding_effect(reset=False)[source]

This method enables or disables the addition of fluid mass in the structural element mass.

Parameters

reset (boll, optional) – True if the fluid mass effect have to be disable. False to enable. Default is False.

generate(path, element_size)[source]

This method evaluates the Lamé’s first parameter lambda.

Parameters
  • path (str) – CAD file path. ‘.igs’ is the only format file supported.

  • element_size (float) – Element size to be used to build the mesh.

get_beam_elements()[source]

This method returns the indexes of the structural beam elements.

Returns

Beam elements indexes.

Return type

list

get_beam_elements_global_dofs()[source]

This method returns the acoustic global degrees of freedom of the nodes associated to structural beam elements. This method helps to exclude those degrees of freedom from acoustic analysis.

Returns

Acoustic global degrees of freedom associated to beam element.

Return type

list

get_beam_nodes_and_indexes()[source]

This method returns the global indexes of the nodes associated to structural beam elements.

Returns

Nodes global indexes associated to beam element.

Return type

list

get_connectivity_matrix(reordering=True)[source]

This method updates the mesh connectivity data. Connectivity matrix row structure: ‘’[Element index, first node index, last node index]’’.

Parameters

reordering (boll, optional.) – True if the nodes numbering is according to the global indexing. False otherwise. Default is True.

get_gdofs_from_nodes(nodeID_1, nodeID_2)[source]

This method returns the ordered global degrees of freedom of two nodes.

Parameters
  • nodeID_1 (int) – Node 1 external index.

  • nodeID_2 (int) – Node 2 external index.

Returns

  • reord_gdofs (list) – Global degrees of freedom ordered according to its indexes.

  • first_node (Node object) – First node.

  • last_node (Node object) – Last node.

get_global_acoustic_indexes()[source]

This method returns the placement of the rows and columns of the acoustic global degrees of freedom in the global matrices.

Returns

  • row (array.) – Integers that place the rows.

  • column (array.) – Integers that place the columns.

get_global_structural_indexes()[source]

This method returns the placement of the rows and columns of the structural global degrees of freedom in the global matrices.

Returns

  • row (array.) – Integers that place the rows.

  • column (array.) – Integers that place the columns.

get_nodal_coordinates_matrix(reordering=True)[source]

This method updates the mesh nodes coordinates data. Coordinates matrix row structure: ‘’[Node index, x-coordinate, y-coordinate, z-coordinate]’’.

Parameters

reordering (boll, optional.) – True if the nodes numbering is according to the global indexing. False otherwise. Default is True.

get_pipe_elements()[source]

This method returns the indexes of the structural pipe elements.

Returns

Pipe elements indexes.

Return type

list

get_pipe_elements_global_dofs()[source]

This method returns the acoustic global degrees of freedom of the nodes associated to structural pipe elements. This method helps to keep only those degrees of freedom in acoustic analysis.

Returns

Acoustic global degrees of freedom associated to pipe element.

Return type

list

get_radius()[source]

This method updates and returns the ????.

Returns

Radius at certain node.

Return type

dictionary

load_mesh(coordinates, connectivity)[source]

This method creates mesh data from nodes coordinates and connectivity matrix.

Parameters
  • coordinates (array.) – Nodes’ coordinates. Each row presents the nodes’ index, x-coordinate, y-coordinate, and z-coordinate. Coordinates matrix row structure: ‘’[Node index, x-coordinate, y-coordinate, z-coordinate]’’.

  • connectivity (array.) – Connectivity matrix. Each row presents the elements’ index, first node index, and last node index. Connectivity matrix row structure: ‘’[Element index, first node index, last node index]’’.

neighboor_elements_of_node(node_ID)[source]

This method returns the acoustic elements that a node belongs to.

Parameters

int – Node external indexes.

Returns

List of acoustic elements indexes.

Return type

List

neighbor_elements_diameter()[source]

This method maps the elements external diameters that each node belongs to. The maping is done according to the node external index.

Returns

External diameters at a certain node. Giving a node external index, returns a list of diameters.

Return type

dict

neighbor_elements_diameter_global()[source]

This method maps the elements internal diameters that each node belongs to. The maping is done according to the node global index.

Returns

Internal diameters at a certain node. Giving a node global index, returns a list of diameters.

Return type

Dict

process_all_rotation_matrices()[source]

This method ???????

process_element_cross_sections_orientation_to_plot()[source]

This method ???????

reset_variables()[source]

This method reset the class default values.

set_B2PX_rotation_decoupling(element_ID, node_ID, rotations_to_decouple=[False, False, False], remove=False)[source]

This method .

Parameters
  • element_ID (list) – Element indexes.

  • nodes_id (list) – Nodes external indexes.

  • rotations_to_decouple (list of bollean, optional) –

    Default is [False, False, False]

  • remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.

set_acoustic_element_type_by_element(elements, element_type, hysteretic_damping=None, remove=False)[source]

This method attributes acoustic element type to a list of elements.

Parameters
  • elements (list) – Acoustic elements indexes.

  • element_type (str, ['dampingless', 'hysteretic', 'wide-duct', 'LRF fluid equivalent', 'LRF full']) – Acoustic element type to be attributed to the listed elements.

  • hysteretic_damping (float, optional) – Acoustic hysteretic damping coefficient. It must be attributed to the elements of type ‘hysteretic’. Default is None.

  • remove (boll, optional) – True if the element_type have to be removed from the acoustic element type dictionary. False otherwise. Default is False.

set_acoustic_element_type_by_line(line, element_type, hysteretic_damping=None, remove=False)[source]

This method attributes acoustic element type to all elements that belongs to a line/entity.

Parameters
  • line (list) – Entities tag.

  • element_type (str, ['dampingless', 'hysteretic', 'wide-duct', 'LRF fluid equivalent', 'LRF full']) – Acoustic element type to be attributed to the listed elements.

  • hysteretic_damping (float, optional) – Acoustic hysteretic damping coefficient. It must be attributed to the elements of type ‘hysteretic’. Default is None.

  • remove (boll, optional) – True if the element_type have to be removed from the acoustic element type dictionary. False otherwise. Default is False.

set_acoustic_pressure_bc_by_node(nodes, value)[source]

This method attributes acoustic pressure boundary condition to a list of nodes.

Parameters
  • nodes (list) – Nodes external indexes.

  • values (complex or array) – Acoustic pressure. Complex valued input corresponds to a constant pressure boundary condition with respect to the frequency. Array valued input corresponds to a variable pressure boundary condition with respect to the frequency.

set_capped_end_by_elements(elements, value, selection)[source]

This method enables or disables the capped end effect in a list of acoustic elements.

Parameters
  • elements (list) – Acoustic elements indexes.

  • value (boll) – True if the capped end effect have to be activated. False otherwise.

  • selection

set_capped_end_by_line(lines, value)[source]

This method enables or disables the capped end effect to all acoustic elements that belongs to a line.

Parameters
  • lines (list) – Lines/entities indexes.

  • value (boll) – True if the capped end effect have to be activated. False otherwise.

set_cross_section_by_element(elements, cross_section, update_cross_section=False)[source]

This method attributes cross section object to a list of acoustic and structural elements.

Parameters
  • elements (list) – Acoustic and structural elements indexes.

  • cross_section (Cross section object) – Tube cross section data.

  • update_cross_section (boll, optional) – True if the cross section data have to be evaluated or updated. False otherwise. Default is False.

set_cross_section_by_line(line, cross_section)[source]

This method attributes cross section object to all elements that belongs to a line/entity.

Parameters
  • line (list) – Entities tag.

  • cross_section (Cross section object) – Tube cross section data.

set_fluid_by_element(elements, fluid)[source]

This method attributes fluid object to a list of acoustic elements.

Parameters
  • elements (list) – Acoustic elements indexes.

  • fluid (Fluid object) – Fluid data.

set_fluid_by_line(lines, fluid)[source]

This method attributes fluid object to all acoustic elements that belongs to a line/entity.

Parameters
  • line/entity (list) – Lines/entities tags.

  • fluid (Fluid object) – Fluid data.

set_length_correction_by_element(elements, value, section, delete_from_dict=False)[source]

This method enables or disables the acoustic length correction effect in a list of acoustic elements.

Parameters
  • elements (list) – Acoustic elements indexes.

  • value ([None, 0, 1, 2]) – Acoustic length correction due to acoustic discontinuities. The prescription is done through the following labeling: None: disable 0 : expansion 1 : side_branch 2 : loop

  • section

  • remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.

set_material_by_element(elements, material)[source]

This method attributes material object to a list of acoustic and structural elements.

Parameters
  • elements (list) – Acoustic and structural elements indexes.

  • material (Material object) – Material data.

set_material_by_line(lines, material)[source]

This method attributes material object to all elements that belongs to a line/entity.

Parameters
  • line (list) – Entities tag.

  • material (Material object) – Material data.

set_prescribed_dofs_bc_by_node(nodes, values)[source]

This method attributes structural displacement and rotation boundary condition to a list of nodes.

Parameters
  • nodes_id (list) – Nodes external indexes.

  • values (complex or array) – Displacement and rotation. Complex valued input corresponds to a constant boundary condition with respect to the frequency. Array valued input corresponds to a variable boundary condition with respect to the frequency.

set_radiation_impedance_bc_by_node(nodes, impedance_type)[source]

This method attributes acoustic lumped radiation impedance to a list of nodes according to the anechoic, flanged, and unflanged prescription.

Parameters
  • nodes (list) – Nodes external indexes.

  • impedance_type ([None, 0, 1, 2]) –

    Acoustic length correction due to acoustic discontinuities. The prescription is done through the following labeling: 0 : anechoic termination 1 : unflanged pipe 2 : flanged pipe

    If None is attributed, then no radiation impedance is considered.

set_specific_impedance_bc_by_node(nodes, values)[source]

This method attributes acoustic lumped specific impedance to a list of nodes.

Parameters
  • nodes (list) – Nodes external indexes.

  • values (complex or array, None) –

    Specific impedance. Complex valued input corresponds to a constant specific impedance with respect to the frequency. Array valued input corresponds to a variable specific impedance with respect to the frequency.

    If None is attributed, then no specific impedance is considered.

set_stress_intensification_by_element(elements, value)[source]

This method enables or disables the stress intensification effect in a list of structural elements.

Parameters
  • elements (list) – Elements indexes.

  • value (boll) – True if the stress intensification effect have to be activated. False otherwise.

set_stress_intensification_by_line(lines, value)[source]

This method enables or disables the stress intensification effect to all structural elements that belongs to a line.

Parameters
  • lines (list) – Lines/entities indexes.

  • value (boll) – True if the stress intensification effect have to be activated. False otherwise.

set_stress_stiffening_by_elements(elements, parameters, section=None, remove=False)[source]

This method .

Parameters
  • lines (list) – Elements indexes.

  • parameters (list) – ????????.

  • section

    Default is None

  • remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.

set_stress_stiffening_by_line(lines, parameters, remove=False)[source]

This method .

Parameters
  • lines (list) – Lines/entities indexes.

  • parameters (list) – ????????.

  • remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.

set_structural_element_type_by_element(elements, element_type, remove=False)[source]

This method attributes structural element type to a list of elements.

Parameters
  • elements (list) – Structural elements indexes.

  • element_type (str, ['pipe_1', 'pipe_2', 'beam_1']) – Structural element type to be attributed to the listed elements.

  • remove (boll, optional) – True if the element_type have to be removed from the structural element type dictionary. False otherwise. Default is False.

set_structural_element_type_by_line(line, element_type, remove=False)[source]

This method attributes structural element type to all elements that belongs to a line/entity.

Parameters
  • line (list) – Entities tag.

  • element_type (str, ['pipe_1', 'pipe_2', 'beam_1']) – Structural element type to be attributed to elements.

  • remove (boll, optional) – True if the element_type have to be removed from the structural element type dictionary. False otherwise. Default is False.

set_structural_load_bc_by_node(nodes_id, values)[source]

This method attributes structural force and moment loads to a list of nodes.

Parameters
  • nodes_id (list) – Nodes external indexes.

  • values (complex or array) – Force and moment loads. Complex valued input corresponds to a constant load with respect to the frequency. Array valued input corresponds to a variable load with respect to the frequency.

set_volume_velocity_bc_by_node(nodes, values, additional_info=None)[source]

This method attributes acoustic volume velocity load to a list of nodes.

Parameters
  • nodes (list) – Nodes external indexes.

  • values (complex or array) – Volume velocity. Complex valued input corresponds to a constant volume velocity load with respect to the frequency. Array valued input corresponds to a variable volume velocity load with respect to the frequency.

Node

class pulse.preprocessing.node.Node(x, y, z, **kwargs)[source]

A node class. This class creates a node object from input data.

Parameters
  • x (float) – Node x coordinate.

  • y (float) – node y coordinate.

  • z (float) – Node z coordinate.

  • global_index (int, optional) – Internal node index used for computing. Default is None.

  • external_index (int) – Node index displayed to the user. Default is None.

admittance(area_fluid, frequencies)[source]

This method returns the node’s lumped acoustic admittance according to either prescribed specific impedance or prescribed radiation impedance. The admittance array has the same length as the frequencies array. In terms of analysis, if admittance is constant in the frequency domain, the method returns an array filled with the constant value with the same length as the frequencies array.

Parameters
  • area_fluid (float) – Acoustic fluid cross section area.

  • frequencies (list) – Frequencies of analysis.

Returns

Lumped acoustic admittance

Return type

complex array

Raises
  • TypeError – The Specific Impedance array and frequencies array must have the same length.

  • TypeError – The Radiation Impedance array and frequencies array must have the same length.

property coordinates

This method returns the node’s coordinates as a array.

Returns

Node coordinates

Return type

array

distance_to(other)[source]

This method returns the distance between the actual node and other one.

Parameters

other (Node object) – The node to calculate the distance to.

Returns

Distance between the nodes.

Return type

float

getAcousticBoundaryCondition()[source]

This method returns the node’s acoustic pressure boundary condition.

Returns

acoustic_boundary_condition – The acoustic pressure boundary condition prescribed into the node.

Return type

complex

See also

set_acoustic_boundary_condition

Attributes the acoustic pressure boundary condition into the node.

get_acoustic_boundary_condition_indexes()[source]

This method returns the index of the acoustic degrees of freedom with prescribed pressure boundary condition.

Returns

indexes – Index of the acoustic degrees with prescribed pressure boundary conditions.

Return type

0 or None

See also

get_acoustic_pressure_bc_values

Acoustic pressure boundary condition if it is prescribed.

get_acoustic_pressure_bc_values()[source]

This method returns the value of the acoustic pressure boundary condition if it is prescribed.

Returns

value – Acoustic pressure boundary condition if it is prescribed.

Return type

complex or None

See also

get_acoustic_boundary_condition_indexes

Index of the acoustic degrees if it has prescribed pressure boundary conditions.

get_lumped_dampings()[source]

This method returns the node’s lumped dampings in the local coordinate system according to the degrees of freedom.

Returns

lumped_dampings – The lumped dampings prescribed into the node.

Return type

array

get_lumped_stiffness()[source]

This method returns the node’s lumped stiffness in the local coordinate system according to the degrees of freedom.

Returns

lumped_stiffness – The lumped stiffness prescribed into the node.

Return type

array

get_prescribed_dofs()[source]

This method returns the node’s structural displacement and rotation boundary conditions in the local coordinate system according to the degrees of freedom.

Returns

boundary_condition – The boundary conditions prescribed into the node.

Return type

array

See also

set_prescribed_dofs_bc

Attributes the structural boundary conditions into the node.

get_prescribed_dofs_bc_indexes()[source]

This method returns the index(es) of the degrees of freedom in the local coordinate system which has(have) prescribed structural displacement or rotation boundary conditions. The array share the same structure of the get_prescribed_dofs_bc_values array.

Returns

indexes – Index(es) of the degrees of freedom which has(have) prescribed structural boundary conditions.

Return type

array

See also

get_prescribed_dofs_bc_values

Value(s) of the prescribed boundary conditions.

get_prescribed_dofs_bc_values()[source]

This method returns the value(s) of the prescribed structural displacement or rotation boundary conditions. The array share the same structure of the get_prescribed_dofs_bc_indexes array.

Returns

indexes – Value(s) of the prescribed structural boundary conditions.

Return type

array

See also

get_prescribed_dofs_bc_indexes

Index(es) of the degrees of freedom which has(have) prescribed boundary conditions.

get_prescribed_loads()[source]

This method returns the prescribed nodal forces and moments load in the local coordinate system according to the the degrees of freedom.

Returns

indexes – Value(s) of the prescribed nodal force and moments boundary conditions.

Return type

array

See also

set_prescribed_loads

Attributes nodal loads in the local coordinate system.

get_volume_velocity(frequencies)[source]

This method returns the node’s acoustic volume velocity boundary condition. The volume velocity array has the same length as the frequencies array. In terms of analysis, if volume velocity is constant in the frequency domain, the method returns a array filled with the constant value with the same length as the frequencies array.

Parameters

frequencies (list) – Frequencies of analysis.

Returns

The acoustic volume velocity boundary condition prescribed into the node.

Return type

complex array

Raises

TypeError – The frequencies array must have the same length of the volume velocity array when a table is prescribed. Please, check the frequency analysis setup.

See also

set_prescribed_volume_velocity

Attributes the node’s acoustic volume velocity boundary condition.

property global_dof

This method returns the node’s structural degrees of freedom in the global coordinate system. The 3D Timoshenko beam theory implemented takes into account the three node’s translations and the three node’s rotations.

Returns

Node’s structural degrees of freedom in the global coordinate system

Return type

list

See also

local_dof

Structural degrees of freedom in the local coordinate system.

haveAcousticBoundaryCondition()[source]

This method evaluates the existence of acoustic pressure boundary condition.

Returns

True when there is acoustic pressure boundary condition prescribed into the node.

Return type

bool

haveVolumeVelocity()[source]

This method evaluates the existence of volume velocity pressure boundary condition.

Returns

True when there is volume velocity pressure boundary condition prescribed into the node, False otherwise.

Return type

bool

property local_dof

This method returns the node’s structural degrees of freedom in the local coordinate system. The 3D Timoshenko beam theory implemented takes into account the three node’s translations and the three node’s rotations.

Returns

Node’s structural degrees of freedom in the local coordinate system.

Return type

list

See also

global_dof

Structural degrees of freedom in the global coordinate system.

set_acoustic_boundary_condition(acoustic_boundary_condition)[source]

This method attributes the node’s acoustic pressure boundary condition.

Parameters

acoustic_boundary_condition (complex) – The acoustic pressure boundary condition to be prescribed into the node.

See also

getAcousticBoundaryCondition

Returns the acoustic pressure boundary condition prescribed into the node.

set_prescribed_dofs_bc(boundary_condition)[source]

This method attributes the node’s structural displacement and rotation boundary conditions in the local coordinate system according to the degrees of freedom.

Parameters

boundary_condition (array) – The structural boundary conditions to be prescribed into the node.

See also

get_prescribed_dofs

Returns the structural boundary conditions prescribed into the node.

set_prescribed_loads(values)[source]

This method attributes the nodal force and moment loads in the local coordinate system according to the the degrees of freedom.

Parameters

indexes (array) – Value(s) of the nodal force and moments to be prescribed boundary conditions.

See also

get_prescribed_loads

Prescribed nodal loads in the local coordinate system.

set_prescribed_volume_velocity(volume_velocity)[source]

This method attributes the node’s acoustic volume velocity boundary condition.

Parameters

volume_velocity (complex) – The acoustic volume velocity boundary condition to be prescribed into the node.

See also

get_volume_velocity

Returns the volume velocity boundary condition prescribed into the node.