Processing¶
Assembly Acoustic¶
- class
pulse.processing.assembly_acoustic.AssemblyAcoustic(mesh, frequencies)[source]¶This class creates a acoustic assembly object from input data.
- Parameters
mesh (Mesh object) – Acoustic finite element mesh.
frequencies (array) – Frequencies of analysis.
get_global_matrices()[source]¶This method perform the assembly process of the acoustic FETM matrices.
- Returns
K (list) – List of admittance matrices of the free degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
Kr (list) – List of admittance matrices of the prescribed degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
get_global_matrices_modal()[source]¶This method perform the assembly process of the acoustic FEM matrices.
- Returns
K (sparse csr_matrix) – Acoustic stiffness matrix.
M (sparse csr_matrix) – Acoustic inertia matrix.
get_global_volume_velocity()[source]¶This method perform the assembly process of the acoustic load, volume velocity.
- Returns
volume_velocity – Volume velocity load.
- Return type
array
get_length_corretion(element)[source]¶This method evaluate the acoustic length correction for an element. The necessary conditions and the type of correction are checked.
- Parameters
element (Acoustic element object) – Acoustic element.
- Returns
Length correction.
- Return type
float
get_lumped_matrices()[source]¶This method perform the assembly process of the acoustic FETM lumped matrices.
- Returns
K_lump (list) – List of lumped admittance matrices of the free degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
Kr_lump (list) – List of lumped admittance matrices of the prescribed degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
get_pipe_and_unprescribed_indexes()[source]¶This method returns all the indexes of the free acoustic degrees of freedom.
- Returns
Indexes of the free acoustic degrees of freedom.
- Return type
array
See also
get_prescribed_valuesValues of the prescribed pressure boundary condition.
get_prescribed_indexesIndexes of the acoustic degrees with prescribed pressure boundary conditions.
get_prescribed_indexes()[source]¶This method returns all the indexes of the acoustic degrees of freedom with prescribed pressure boundary condition.
- Returns
Indexes of the acoustic degrees with prescribed pressure boundary conditions.
- Return type
array
See also
get_prescribed_valuesValues of the prescribed pressure boundary condition.
get_unprescribed_indexesIndexes of the free acoustic degrees of freedom.
get_prescribed_values()[source]¶This method returns all the values of the prescribed pressure boundary condition.
- Returns
Values of the prescribed pressure boundary condition.
- Return type
array
See also
get_prescribed_indexesIndexes of the acoustic degrees with prescribed pressure boundary conditions.
get_unprescribed_indexesIndexes of the free acoustic degrees of freedom.
get_unprescribed_indexes()[source]¶This method returns all the indexes of the free acoustic degrees of freedom.
- Returns
Indexes of the free acoustic degrees of freedom.
- Return type
array
See also
get_prescribed_valuesValues of the prescribed pressure boundary condition.
get_prescribed_indexesIndexes of the acoustic degrees with prescribed pressure boundary conditions.
pulse.processing.assembly_acoustic.length_correction_branch(branch_diameter, principal_diameter)[source]¶This function returns the acoustic length correction due to sidebranch in the acoustic domain. This discontinuity is characterized by three elements, two with the same diameters in line, and the other with different diameter connected to these two.
- Parameters
smaller_diameter (float) – Smaller diameter between the two elements diameters.
larger_diameter (float) – Larger diameter between the two elements diameters.
- Returns
Length correction due to side branch.
- Return type
float
See also
length_correction_expansionLength correction due to expansion in the acoustic domain.
pulse.processing.assembly_acoustic.length_correction_expansion(smaller_diameter, larger_diameter)[source]¶This function returns the acoustic length correction due to expansion in the acoustic domain. This discontinuity is characterized by two elements in line with different diameters.
- Parameters
smaller_diameter (float) – Smaller diameter between the two elements diameters.
larger_diameter (float) – Larger diameter between the two elements diameters.
- Returns
Length correction due to expansion.
- Return type
float
See also
length_correction_branchLength correction due to sidebranch in the acoustic domain.
Assembly Structural¶
- class
pulse.processing.assembly_structural.AssemblyStructural(mesh, frequencies, **kwargs)[source]¶This class creates a structural assembly object from input data.
- Parameters
mesh (Mesh object) – Acoustic finite element mesh.
frequencies (array) – Frequencies of analysis.
acoustic_solution (array, optional) – Solution of the acoustic FETM model. This solution is need to solve the coupled problem. Default is None.
get_bc_array_for_all_frequencies(there_are_table, boundary_condition)[source]¶This method perform the assembly process of the structural FEM force and moment loads.
- Parameters
pressure_external (float, optional) – Static pressure difference between atmosphere and the fluid in the pipeline. Default is 0.
loads_matrix3D (boll, optional) – Default is False.
- Returns
Loads vectors. Each column corresponds to a frequency of analysis.
- Return type
array
get_global_loads(pressure_external=0, loads_matrix3D=False)[source]¶This method perform the assembly process of the structural FEM force and moment loads.
- Parameters
pressure_external (float, optional) – Static pressure difference between atmosphere and the fluid in the pipeline. Default is 0.
loads_matrix3D (boll, optional) – Default is False.
- Returns
Loads vectors. Each column corresponds to a frequency of analysis.
- Return type
array
get_global_matrices()[source]¶This method perform the assembly process of the structural FEM matrices.
- Returns
K (list) – List of stiffness matrices of the free degree of freedom. Each item of the list is a sparse csr_matrix.
M (list) – List of mass matrices of the free degree of freedom. Each item of the list is a sparse csr_matrix.
Kr (list) – List of stiffness matrices of the prescribed degree of freedom. Each item of the list is a sparse csr_matrix.
Mr (list) – List of mass matrices of the prescribed degree of freedom. Each item of the list is a sparse csr_matrix.
get_lumped_matrices()[source]¶This method perform the assembly process of the structural FEM lumped matrices.
- Returns
K_lump (list) – List of lumped stiffness matrices of the free degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
M_lump (list) – List of mass matrices of the free degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
C_lump (list) – List of lumped damping matrices of the free degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
Kr_lump (list) – List of lumped stiffness matrices of the prescribed degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
Mr_lump (list) – List of lumped mass matrices of the prescribed degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
Cr_lump (list) – List of lumped damping matrices of the prescribed degree of freedom. Each item of the list is a sparse csr_matrix that corresponds to one frequency of analysis.
flag_Clump (boll) – This flag returns True if the damping matrices are non zero, and False otherwise.
get_prescribed_indexes()[source]¶This method returns all the indexes of the structural degrees of freedom with prescribed structural displacement or rotation boundary conditions.
- Returns
Indexes of the structural degrees of freedom with prescribed displacement or rotation boundary conditions.
- Return type
array
See also
get_prescribed_valuesVaslues of the structural degrees of freedom with prescribed displacement or rotation boundary conditions.
get_unprescribed_indexesIndexes of the structural free degrees of freedom.
get_prescribed_values()[source]¶This method returns all the values of the structural degrees of freedom with prescribed structural displacement or rotation boundary conditions.
- Returns
Values of the structural degrees of freedom with prescribed displacement or rotation boundary conditions.
- Return type
array
See also
get_prescribed_indexesIndexes of the structural degrees of freedom with prescribed displacement or rotation boundary conditions.
get_unprescribed_indexesIndexes of the structural free degrees of freedom.
get_unprescribed_indexes()[source]¶This method returns all the indexes of the structural free degrees of freedom.
- Returns
Indexes of the structural free degrees of freedom.
- Return type
array
See also
get_prescribed_indexesIndexes of the structural degrees of freedom with prescribed displacement or rotation boundary conditions.
get_prescribed_valuesValues of the structural degrees of freedom with prescribed displacement or rotation boundary conditions.
Solution Acoustic¶
- class
pulse.processing.solution_structural.SolutionStructural(mesh, frequencies, **kwargs)[source]¶This class creates a Structural Solution object from input data.
- Parameters
mesh (Mesh object) – Structural finite element mesh.
frequencies (array) – Frequencies of analysis.
acoustic_solution (array, optional) – Solution of the acoustic FETM model. This solution is need to solve the coupled problem. Default is None.
_reinsert_prescribed_dofs(solution, modal_analysis=False)[source]¶This method reinsert the value of the prescribed degree of freedom in the solution. If modal analysis is performed, the values are zeros.
- Parameters
solution (array) – Solution data from the direct method, modal superposition or modal shapes from modal analysis.
modal_analysis (boll, optional) – True if the modal analysis was evaluated.
- Returns
Solution of all the degrees of freedom.
- Return type
array
direct_method(global_damping)[source]¶This method evaluates the harmonic analysis through direct method. It is suitable for Viscous Proportional and Hysteretic Proportional damping models.
- Parameters
global_damping (list of floats.) – Damping coefficients alpha viscous, beta viscous, alpha histeretic, and beta histeretic.
- Returns
Solution. Each column corresponds to a frequency of analysis. Each row corresponds to a degree of freedom.
- Return type
array
get_combined_loads(global_damping)[source]¶This method adds the effects of prescribed displacement and rotation into global loads vector.
- Parameters
global_damping (list of floats.) – Damping coefficients alpha viscous, beta viscous, alpha histeretic, and beta histeretic.
- Returns
Force and moment global loads. Each column corresponds to a frequency of analysis.
- Return type
array
get_reactions_at_fixed_nodes(global_damping_values=(0, 0, 0, 0))[source]¶This method evaluates reaction forces and moments at fixed nodes.
- Parameters
global_damping (list of floats.) – Damping coefficients alpha viscous, beta viscous, alpha histeretic, and beta histeretic.
- Returns
Reactions. Each column corresponds to a frequency of analysis. Each row corresponds to a fixed degree of freedom.
- Return type
array
get_reactions_at_springs_and_dampers()[source]¶This method evaluates reaction forces and moments at lumped springs and dampers connected the structure and the ground.
- Returns
Reactions. Each column corresponds to a frequency of analysis. Each row corresponds to a spring and damper.
- Return type
array
modal_analysis(K=[], M=[], modes=20, which='LM', sigma=0.01, harmonic_analysis=False)[source]¶This method evaluates the FEM acoustic modal analysis. The FETM formulation is not suitable to performe modal analysis.
- Parameters
modes (int, optional) – Number of acoustic modes to be evaluated. Default is 20.
which (str, ['LM' | 'SM' | 'LR' | 'SR' | 'LI' | 'SI'], optional) –
- Which k eigenvectors and eigenvalues to find:
’LM’ : largest magnitude ‘SM’ : smallest magnitude ‘LR’ : largest real part ‘SR’ : smallest real part ‘LI’ : largest imaginary part ‘SI’ : smallest imaginary part
Default is ‘LM’.
sigma (float, optional) – Find eigenvalues near sigma in (rad/s)^2 using shift-invert mode.
harmonic_analysis (boll, optional) – True when the modal analysis is used to perform mode superposition. False otherwise. Default is False.
- Returns
natural_frequencies (array) – Natural frequencies.
modal_shapes (array) – Modal shapes
mode_superposition(modes, global_damping, F_loaded=None, fastest=True)[source]¶This method evaluates the harmonic analysis through mode superposition method. It is suitable for Viscous Proportional and Hysteretic Proportional damping models.
- Parameters
global_damping (list of floats.) – Damping coefficients alpha viscous, beta viscous, alpha histeretic, and beta histeretic.
F_loaded (,optional.) – Default None.
fastest (boll, optional.) – True if 3D matrix solution procedure must be used. False otherwise. Default True.
- Returns
Solution. Each column corresponds to a frequency of analysis. Each row corresponds to a degree of freedom.
- Return type
array
stress_calculate(global_damping, pressure_external=0, damping_flag=False, _real_values=False)[source]¶This method evaluates reaction forces and moments at lumped springs and dampers connected the structure and the ground.
- Parameters
global_damping (list of floats.) – Damping coefficients alpha viscous, beta viscous, alpha histeretic, and beta histeretic.
pressure_external (float, optional) – Static pressure difference between atmosphere and the fluid in the pipeline. Default is 0.
damping_flag (boll, optional.) – True if the damping must be considered when evaluating the stresses. False otherwise. Default is False
- Returns
- Stresses. Each column corresponds to a element. The rows corresponds to the:
Normal axial stress Normal bending-y stress Normal bending-z stress Hoop stress Torsional shear Transversal-xy shear Transversal-xz shear
- Return type
array
Solution Structural¶
- class
pulse.processing.solution_acoustic.SolutionAcoustic(mesh, frequencies)[source]¶This class creates a Acoustic Solution object from input data.
- Parameters
mesh (Mesh object) – Acoustic finite element mesh.
frequencies (array) – Frequencies of analysis.
_reinsert_prescribed_dofs(solution, modal_analysis=False)[source]¶This method reinsert the value of the prescribed degree of freedom in the solution. If modal analysis is performed, the values are zeros.
- Parameters
solution (array) – Solution data from the direct method, modal superposition or modal shapes from modal analysis.
modal_analysis (boll, optional) – True if the modal analysis was evaluated.
- Returns
Solution of all the degrees of freedom.
- Return type
array
direct_method()[source]¶This method evaluate the FETM acoustic solution through direct method.
- Returns
Solution. Each column corresponds to a frequency of analysis. Each row corresponds to a degree of freedom.
- Return type
array
get_combined_volume_velocity()[source]¶This method adds the effects of prescribed acoustic pressure into volume velocity global vector.
- Returns
Volume velocity. Each column corresponds to a frequency of analysis.
- Return type
array
modal_analysis(modes=20, which='LM', sigma=0.01)[source]¶This method evaluate the FEM acoustic modal analysis. The FETM formulation is not suitable to performe modal analysis.
- Parameters
modes (int, optional) – Number of acoustic modes to be evaluated. Default is 20.
which (str, ['LM' | 'SM' | 'LR' | 'SR' | 'LI' | 'SI'], optional) –
- Which k eigenvectors and eigenvalues to find:
’LM’ : largest magnitude ‘SM’ : smallest magnitude ‘LR’ : largest real part ‘SR’ : smallest real part ‘LI’ : largest imaginary part ‘SI’ : smallest imaginary part
Default is ‘LM’.
sigma (float, optional) – Find eigenvalues near sigma (in (rad/s)^2) using shift-invert mode. Default is 0.01.
- Returns
natural_frequencies (array) – Natural frequencies.
modal_shapes (array) – Modal shapes