Karana.FEMBridge#
Classes and functions used to convert a NASTRAN model into a flexible body model.
The flexible body model can then be transformed into a PhysicalModalBody with a single line. This is the easiest and recommended way to bring NASTRAN models into Karana Dynamics simulations.
Submodules#
Classes#
Convert NASTRAN models into flexible body models. |
|
Parameters used for modal analysis. |
Functions#
|
Create a PacketTableConfig that logs flexible body data needed to |
Package Contents#
- Karana.FEMBridge.bodyMdfLogger(name: str, sp: Karana.Dynamics.StatePropagator, body: Karana.Dynamics.PhysicalModalBody) Karana.KUtils.PacketTableConfig#
Create a PacketTableConfig that logs flexible body data needed to recover stress.
- Parameter
name: The name of the PacketTableConfig.
- Parameter
sp: The StatePropagator used to retrieve time.
- Parameter
body: The body whose information will be logged.
- Returns:
PacketTableConfig with the appropriate information.
- Parameter
- class Karana.FEMBridge.NastranModalAnalysis(config: ModalAnalysisDS)[source]#
Convert NASTRAN models into flexible body models.
This class processes a NASTRAN model in the following way: * Using user-defined parameters, modify the NASTRAN run deck to retrieve the appropriate
mode shapes. These mode shapes are component mode shapes obtained using the Craig Bampton method.
Extra parameters such as residual vectors or modal integrals can also be obtained by setting the appropriate parameters.
Run NASTRAN on the modified run deck and save the results into an HDF5 file. This file contains all of the critical data needed to create a PhysicalModalBody.
- nastran_executable = 'nastran'#
- class Karana.FEMBridge.ModalAnalysisDS(/, **data: Any)[source]#
Bases:
Karana.KUtils.DataStruct.DataStructParameters used for modal analysis.
- Parameters:
input_file (FilePath) – Input NASTRAN run deck or bulk data file.
analysis_dir (Path) – Analysis directory. If a path is not is not specified, will use analysis_INPUT_FILE_NAME.
output_file (Path) – Output HDF5 file.
grdpnt (Annotated[int, Field(ge=0)]) – Reference point. If 0, then use the origin of the basic coordinate system.
n_modes (Optional[Annotated[int, Field(ge=1)]]) – Number of modes to keep. The Nastran QRG specifies how this parameter works with the frequency lower bound and upper bound.
rigid_mode_cutoff (NonNegativeFloat) – The rigid mode cuttoff to use in radians.
freq_lb (Optional[NonNegativeFloat]) – Lower bound for modes.
freq_ub (Optional[NonNegativeFloat]) – Upper bound for modes.
aset (dict[NonNegativeInt, int]) – Nodes to include in the aset.
rvdof (dict[NonNegativeInt, int]) – Nodes to include in the aset.
output_cs (Optional[int]) – Number of the output coordinate system. This will be assigned to the CD field of the GRDSET card.
stress_recovery_op2 (bool) – If True, then add commands to produce an op2 file that can be used to recover stress. Note, that at the time this is written, pyNastran cannot read these op2 files. Hence, for stress recovery, one must run the analysis twice. Once in stres recovery mode and once in regular mode.
- input_file: pydantic.FilePath#
- analysis_dir: pathlib.Path#
- output_file: pathlib.Path#
- grdpnt: Karana.KUtils.Ktyping.NonNegativeInt = 0#
- n_modes: Annotated[int, Field(ge=1)] | None = None#
- rigid_mode_cutoff: Karana.KUtils.Ktyping.NonNegativeFloat = 0.001#
- freq_lb: Karana.KUtils.Ktyping.NonNegativeFloat | None = None#
- freq_ub: Karana.KUtils.Ktyping.NonNegativeFloat | None = None#
- aset: dict[Karana.KUtils.Ktyping.NonNegativeInt, int]#
- rvdof: dict[Karana.KUtils.Ktyping.NonNegativeInt, int]#
- output_cs: int | None = None#
- stress_recovery_op2: bool = False#
- property output_bdf: pathlib.Path#
Retrieve the transformed bulk data filepath as a Path.
- property output_f06: str#
Retrieve the output F06 file as a Path.
- property output_op2: pathlib.Path#
Retrieve the output OP2 file as a string.
- property n_modes_minus_aset: int | None#
The number of modes the user requests will be augmented aset modes.
We use this to fix that issue by subracting off, so the user gets the number of modes that they want.
- property n_modes_w_rv: int | None#
Retrive the number of modes + the number of residual vectors.