Models
fenics-constitutive: Interfaces for constitutive models for dolfinx
__all__
module-attribute
__all__ = ['LinearElasticityModel', 'MisesPlasticityLinearHardening3D', 'SpringKelvinModel', 'SpringMaxwellModel', 'VonMises3D']
IncrSmallStrainModel
Bases: ABC
Interface for incremental small strain models.
Source code in src/fenics_constitutive/models/interfaces.py
constraint
abstractmethod
property
The constraint for the stresses or the strains.
Returns:
| Type | Description |
|---|---|
StressStrainConstraint
|
The constraint. |
geometric_dim
property
The geometric dimension that the model is implemented for.
Returns:
| Type | Description |
|---|---|
int
|
The geometric dimension. |
history_dim
abstractmethod
property
The dimensions of history variable(s). This is needed to tell the solver which quadrature spaces or arrays to build. If it is not none, a dictionary is returned with the name of the history variable as key and the dimension of the history variable as value.
Returns:
| Type | Description |
|---|---|
dict[str, int | tuple[int, int]] | None
|
The dimension of the history variable(s). |
stress_strain_dim
property
The stress-strain dimension that the model is implemented for.
Returns:
| Type | Description |
|---|---|
int
|
The stress-strain dimension. |
evaluate
abstractmethod
evaluate(t: float, del_t: float, grad_del_u: ndarray, stress: ndarray, tangent: ndarray | None, history: dict[str, ndarray] | None) -> None
Evaluate the constitutive model and overwrite the stress, tangent and history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
The current global time . |
required |
|
float
|
The time increment . The time at the end of the increment is . |
required |
|
ndarray
|
The gradient of the increment of the displacement field with . |
required |
|
ndarray
|
The current stress in Mandel notation. |
required |
|
ndarray | None
|
The tangent compatible with Mandel notation. |
required |
|
dict[str, ndarray] | None
|
The history variable(s). |
required |
Source code in src/fenics_constitutive/models/interfaces.py
LinearElasticityModel
Bases: IncrSmallStrainModel
A linear elastic material model which has been implemented for all constraints.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, float]
|
Material parameters. Must contain "E" for the Youngs modulus and "nu" for the Poisson ratio. |
required |
|
StressStrainConstraint
|
Constraint type. |
required |
Source code in src/fenics_constitutive/models/linear_elasticity_model.py
MisesPlasticityLinearHardening3D
Bases: IncrSmallStrainModel
A von Mises plasticity model with linear hardening for 3D stress states.
This class implements the von Mises yield criterion with linear isotropic hardening. The yield function is defined as: , where:
- is the deviatoric stress tensor
- is the current yield stress
- is the equivalent plastic strain
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, ndarray]
|
A dictionary containing:
|
required |
Source code in src/fenics_constitutive/models/rust_models.py
PlaneStrainFrom3D
Bases: IncrSmallStrainModel
Convert a 3D model to a plane strain model. This is achieved by copying the relevant 2D components to a 3D array, calling the 3D model, and then copying the 3D components back to the 2D array. Since this converter creates new arrays for the 3D components, it is (probably) not suitable for large-scale simulations due to the memory consumption.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IncrSmallStrainModel
|
3D model to convert to plane strain. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
model |
IncrSmallStrainModel
|
3D model to convert to plane strain. |
stress_3d |
ndarray
|
3D stress array. |
tangent_3d |
ndarray
|
3D tangent array. |
grad_del_u_3d |
ndarray
|
3D array of gradient of displacement increment. |
Source code in src/fenics_constitutive/models/utils.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
SpringKelvinModel
Bases: IncrSmallStrainModel
viscoelastic model based on 1D Three Parameter Model with spring and Kelvin body in row
|--- E_1: spring ---|
--- E_0: spring ---| |--
|--- eta: damper ---|
with deviatoric assumptions for 3D generalization (volumetric part of visco strain == 0 damper just working on deviatoric part) time integration: backward Euler
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, float]
|
Material parameters. Must contain "E0" for the elastic Youngs modulus, "E1" for the viscous modulus and "tau" for the relaxation time. |
required |
|
StressStrainConstraint
|
Constraint type. |
required |
Source code in src/fenics_constitutive/models/spring_kelvin_model.py
SpringMaxwellModel
Bases: IncrSmallStrainModel
viscoelastic model based on 1D Three Parameter Model with spring and Maxwell body in parallel
|----------- E_0: spring ----------|
--| |--
|--- E_1: spring --- eta: damper ---|
with deviatoric assumptions for 3D generalization (volumetric part of visco strain == 0 damper just working on deviatoric part) time integration: backward Euler
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, float]
|
Material parameters. Must contain "E0" for the elastic Youngs modulus, "E1" for the viscous modulus and "tau" for the relaxation time. |
required |
|
StressStrainConstraint
|
Constraint type. |
required |
Source code in src/fenics_constitutive/models/spring_maxwell_model.py
StressStrainConstraint
Bases: Enum
Enum for the model constraint.
The constraint can either be: UNIAXIAL_STRAIN, UNIAXIAL_STRESS, PLANE_STRAIN, PLANE_STRESS, FULL
Source code in src/fenics_constitutive/models/interfaces.py
UniaxialStrainFrom3D
Bases: IncrSmallStrainModel
Convert a 3D model to a uniaxial strain model. This is achieved by copying the relevant 1D components to a 3D array, calling the 3D model, and then copying the 3D components back to the 1D array. Since this converter creates new arrays for the 3D components, it is (probably) not suitable for large-scale simulations due to the memory consumption.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
IncrSmallStrainModel
|
3D model to convert to uniaxial strain. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
model |
IncrSmallStrainModel
|
3D model to convert to uniaxial strain. |
stress_3d |
ndarray
|
3D stress array. |
tangent_3d |
ndarray
|
3D tangent array. |
grad_del_u_3d |
ndarray
|
3D array of gradient of displacement increment. |
Source code in src/fenics_constitutive/models/utils.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
VonMises3D
Bases: IncrSmallStrainModel
Von Mises Plasticity model with non-linear isotropic hardening. Computation of trial stress state is entirely deviatoric. Volumetric part is added later when the stress increment for the current time step is calculated.
Following are the elastic potential, plastic potential and yield surface accordingly
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, float]
|
Must contain following material parameters: p_ka : bulk modulus, p_mu : shear modulus, p_y0 : initial yield stress, p_y00 : final yield stress, p_w : saturation parameter |
required |
Source code in src/fenics_constitutive/models/mises_plasticity_isotropic_hardening.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
get_elastic_tangent
Get the linear elastic tangent based on the stress-strain constraint. Args: E (float): Young's modulus. nu (float): Poisson's ratio. constraint (StressStrainConstraint): Stress-strain constraint (.FULL, PLANE_STRAIN, PLANE_STRESS, UNIAXIAL_STRAIN, UNIAXIAL_STRESS).
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Elastic tangent matrix. |
Source code in src/fenics_constitutive/models/utils.py
get_identity
Get the identity tensor based on the stress-strain constraint. Args: stress_strain_dim (int): Dimension of the stress/strain vector. constraint (StressStrainConstraint): Stress-strain constraint (.FULL, PLANE_STRAIN, PLANE_STRESS, UNIAXIAL_STRAIN, UNIAXIAL_STRESS) Returns: np.ndarray: Identity tensor.
Source code in src/fenics_constitutive/models/utils.py
lame_parameters
Compute Lame parameters (mu, lam) from Young's modulus E and Poisson's ratio nu.
Source code in src/fenics_constitutive/models/utils.py
strain_from_grad_u
Compute the strain in Mandel notation from the gradient of displacement (or increments of both quantities).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ndarray
|
Gradient of displacement field. |
required |
|
StressStrainConstraint
|
Constraint that the model is implemented for. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Numpy array containing the strain for all IPs. |
Source code in src/fenics_constitutive/models/utils.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |