N2PUpdateFastener Module#
- class NaxToPy.Modules.static.fasteners.N2PUpdateFastener.N2PUpdateFastener[source]#
Bases:
object
This class stores information about fasteners and provides methods to update their stiffness and generate a new FEM Input File (.bdf, .fem, .dat, etc.) file with the updated data.
Fastener information can be input either as a dictionary (for a single type of fastener) or as a list of dictionaries (for multiple types). Each dictionary must include at least the keys for diameter [“D”] and elastic modulus [“E”]. Optional keys include head height [“h_head”], nut height [“h_nut”], Poisson ratio [“nu”], shear modulus [“G”], connection type (“bolt” or “rivet”) [“connection_type”], shear type (“simple” or “double”) [“shear_type”], and the beta value for Nelson method [“beta”].
IDs of fasteners to be updated can be provided as either a single list (for a single type of fastener) or as a list of lists (for multiple types). If no list of IDs is provided, all fasteners in the model will be updated.
When multiple types of fasteners are used, the order of the list of dictionaries must match the order of the list of ID lists to ensure proper mapping of variables.
Supported methods for stiffness calculation include HUTH, TATE_ROSENFELD, SWIFT, BOEING, GRUMMAN, and NELSON.
Example
>>> import NaxToPy as n2p >>> model = n2p.load_model("model.dat") >>> update = N2PUpdateFastener() >>> update.Model = model >>> prop1 = {"E": 70000, "D": 4.8} >>> prop2 = {"E": 140000, "D": 7.2, "connection_type": "rivet", "shear_type": "double"} >>> update.FastenerInformation = { ... (1000, "0"): prop1, ... (1001, "0"): prop1, ... (1000, "1"): prop2, ... (1001, "1"): prop2 ... } >>> update.calculate() # This will update the model in memory with the information of the object. >>> update.write_bdf() # With the model updated, the model is rewritten
Note
In the example, it is shown that there are only two types of fasteners (prop1 and prop2), and the fastener keys reference them instead of creating a separate fastener type for each one, which would be highly inefficient.
- calculate() None [source]#
Update properties of fasteners in a model.
Reads a model from a BDF file and updates the properties of PFAST and PBUSH elements. If a list of fastener IDs is provided, it updates the properties of those elements.
- write_bdf(out_folder: str) None [source]#
Write the model with the same file structure and the updates made by calculate() in the directory introduced.
- ALLOWED_METHODS = {'BOEING', 'GRUMMAN', 'HUTH', 'NELSON', 'SWIFT', 'TATE_ROSENFELD'}#
- property FastenerInformation: dict[tuple, dict]#
Dictionary that maps each fastener with its properties. The key it is a tuple with the ID and Part of of the fastener and the value is a dict with the keys as string (name of the property) and value.
Warning
The mandatory keys for the properties dict are young modulus “E” and diameter “D”:
Note
The optional keys are: - “shear_type” may be “simple” (default) or “double”. - “connection_type” may be “bolt” (default) or “rivet”. - “h_head” 0 by default. - “h_nut” 0 by default. - “nu” 0.33 by default. - “G” equal to E/(2*(1+nu)) by default. - “beta” 0.5 by default.
Example
>>> prop1 = {"E": 70000, "D": 4.8} >>> prop2 = {"E": 140000, "D": 7.2, "connection_type": "rivet", "shear_type": "double"} >>> update1.FastenerInformation = { ... (1000, "0"): prop1, ... (1001, "0"): prop1, ... (1000, "1"): prop2, ... (1001, "1"): prop2 ... }
Note
In the example, it is shown that there are only two types of fasteners (prop1 and prop2), and the fastener keys reference them instead of creating a separate fastener type for each one, which would be highly inefficient.
- property Model: N2PModelContent#
Instance of N2PModelContent with the model from a input file read to update the fasteners.
- property StiffnessMethod: str#
Name of the method used to calculate the fastener stiffness. It can be: - “HUTH” - “BOEING” - “TATE_ROSENFELD” - “GRUMMAN” - “SWIFT” - “NELSON”