KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
hcf_data_container.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Alireza Taherzadeh-Fard
11 // Alejandro Cornejo
12 //
13 //
14 
15 # pragma once
16 
17 // System includes
18 
19 // External includes
20 
21 // Project includes
23 
24 namespace Kratos
25 {
28 
31 
40 {
41 public:
42 
44  double MaxStress = 0.0;
45  double MinStress = 0.0;
46  bool MaxIndicator = false;
47  bool MinIndicator = false;
49  double FatigueReductionFactor = 1.0;
51  double MaxStressRelativeError = 0.0;
52  unsigned int GlobalNumberOfCycles = 1;
53  unsigned int LocalNumberOfCycles = 1;
54  double B0 = 0.0;
55  double PreviousMaxStress = 0.0;
56  double PreviousMinStress = 0.0;
57  double WohlerStress = 1.0;
58  double Sth = 0.0;
59  double CyclesToFailure = 0.0;
60  bool NewCycle = false;
61  double Alphat = 0.0;
63  double ReversionFactor = 0.0;
66  };
67 
68  static constexpr double tolerance = 1.0e-3;
69 
71  {};
72 
73  // Defining fatigue methods
74 
79  void CalculateSminAndSmax(const double CurrentStress,
80  HCFDataContainer::FatigueVariables &rFatigueVariables);
81 
86  double CalculateTensionOrCompressionIdentifier(const Vector& rStressVector);
87 
92  double CalculateReversionFactor(const double MaxStress, const double MinStress);
93 
98  void CalculateFatigueParameters(const Properties& rMaterialParameters, HCFDataContainer::FatigueVariables &rFatigueVariables);
99 
104  void CalculateFatigueReductionFactorAndWohlerStress(const Properties& rMaterialParameters, HCFDataContainer::FatigueVariables &rFatigueVariables);
105 
106 
112 
113 
118 
119 
124  const Properties& rMaterialProperties,
125  const ProcessInfo& rCurrentProcessInfo,
126  ConstitutiveLaw::StressVectorType stress_vector,
127  double uniaxial_stress);
128 
132  int Check(const Properties& rMaterialProperties);
133 
134 
135 
136 private:
137 
140 
144  double mMaxStress = 0.0;
145  double mMinStress = 0.0;
146  bool mMaxDetected = false;
147  bool mMinDetected = false;
148  Vector mPreviousStresses = ZeroVector(2);
149  double mFatigueReductionFactor = 1.0;
150  double mReversionFactorRelativeError = 0.0;
151  double mMaxStressRelativeError = 0.0;
152  unsigned int mNumberOfCyclesGlobal = 1;
153  unsigned int mNumberOfCyclesLocal = 1;
154  double mPreviousMaxStress = 0.0;
155  double mPreviousMinStress = 0.0;
156  double mWohlerStress = 1.0;
157  double mThresholdStress = 0.0;
158  double mCyclesToFailure = std::numeric_limits<double>::infinity();
159  bool mNewCycleIndicator = false;
161 
162 friend class Serializer;
163 
164 void save(Serializer& rSerializer) const
165 {
166  rSerializer.save("MaxStress",mMaxStress);
167  rSerializer.save("MinStress",mMinStress);
168  rSerializer.save("MaxDetected",mMaxDetected);
169  rSerializer.save("MinDetected",mMinDetected);
170  rSerializer.save("PreviousStresses",mPreviousStresses);
171  rSerializer.save("FatigueReductionFactor",mFatigueReductionFactor);
172  rSerializer.save("ReversionFactorRelativeError",mReversionFactorRelativeError);
173  rSerializer.save("MaxStressRelativeError",mMaxStressRelativeError);
174  rSerializer.save("NumberOfCyclesGlobal",mNumberOfCyclesGlobal);
175  rSerializer.save("NumberOfCyclesLocal",mNumberOfCyclesLocal);
176  rSerializer.save("PreviousMaxStress",mPreviousMaxStress);
177  rSerializer.save("PreviousMinStress",mPreviousMinStress);
178  rSerializer.save("WohlerStress",mWohlerStress);
179  rSerializer.save("ThresholdStress",mThresholdStress);
180  rSerializer.save("CyclesToFailure",mCyclesToFailure);
181  rSerializer.save("NewCycleIndicator",mNewCycleIndicator);
182 }
183 
184 void load(Serializer& rSerializer)
185 {
186  rSerializer.load("MaxStress",mMaxStress);
187  rSerializer.load("MinStress",mMinStress);
188  rSerializer.load("MaxDetected",mMaxDetected);
189  rSerializer.load("MinDetected",mMinDetected);
190  rSerializer.load("PreviousStresses",mPreviousStresses);
191  rSerializer.load("FatigueReductionFactor",mFatigueReductionFactor);
192  rSerializer.load("ReversionFactorRelativeError",mReversionFactorRelativeError);
193  rSerializer.load("MaxStressRelativeError",mMaxStressRelativeError);
194  rSerializer.load("NumberOfCyclesGlobal",mNumberOfCyclesGlobal);
195  rSerializer.load("NumberOfCyclesLocal",mNumberOfCyclesLocal);
196  rSerializer.load("PreviousMaxStress",mPreviousMaxStress);
197  rSerializer.load("PreviousMinStress",mPreviousMinStress);
198  rSerializer.load("WohlerStress",mWohlerStress);
199  rSerializer.load("ThresholdStress",mThresholdStress);
200  rSerializer.load("CyclesToFailure",mCyclesToFailure);
201  rSerializer.load("NewCycleIndicator",mNewCycleIndicator);
202 }
203 
204 }; // class
206 
208 
209 } // namespace Kratos
Defining all the methods and variables required in fatigue simulations.
Definition: hcf_data_container.h:40
void CalculateFatigueReductionFactorAndWohlerStress(const Properties &rMaterialParameters, HCFDataContainer::FatigueVariables &rFatigueVariables)
This method calculates fatigue reduction factor and Wohler stress.
Definition: hcf_data_container.cpp:119
double CalculateTensionOrCompressionIdentifier(const Vector &rStressVector)
This method identifies if the overall load state is tension or compression.
Definition: hcf_data_container.cpp:50
void InitializeFatigueVariables(HCFDataContainer::FatigueVariables &rFatigueVariables)
This method initializes all the values in the FatigueVariables.
Definition: hcf_data_container.cpp:135
void CalculateSminAndSmax(const double CurrentStress, HCFDataContainer::FatigueVariables &rFatigueVariables)
This method sets maximum and minimum stresses for fatigue calculations.
Definition: hcf_data_container.cpp:33
double CalculateReversionFactor(const double MaxStress, const double MinStress)
This method calculates the reversion factor based on the maximum and minimum stresses.
Definition: hcf_data_container.cpp:58
static constexpr double tolerance
Definition: hcf_data_container.h:68
int Check(const Properties &rMaterialProperties)
This method checks the fatigue inout properties.
Definition: hcf_data_container.cpp:240
HCFDataContainer()
Definition: hcf_data_container.h:70
void UpdateFatigueVariables(HCFDataContainer::FatigueVariables &rFatigueVariables)
This method updates all member variables.
Definition: hcf_data_container.cpp:158
void CalculateFatigueParameters(const Properties &rMaterialParameters, HCFDataContainer::FatigueVariables &rFatigueVariables)
This method sets the variables required for calculating fatigue reduction factor and Wohler stress.
Definition: hcf_data_container.cpp:66
void FinalizeSolutionStep(HCFDataContainer::FatigueVariables &rFatigueVariables, const Properties &rMaterialProperties, const ProcessInfo &rCurrentProcessInfo, ConstitutiveLaw::StressVectorType stress_vector, double uniaxial_stress)
This method computes fatigue-related quantities.
Definition: hcf_data_container.cpp:180
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
def load(f)
Definition: ode_solve.py:307
Definition: hcf_data_container.h:43
double PreviousReversionFactor
Definition: hcf_data_container.h:62
bool DamageActivation
Definition: hcf_data_container.h:65
bool AdvanceStrategyApplied
Definition: hcf_data_container.h:64
double PreviousMaxStress
Definition: hcf_data_container.h:55
double CyclesToFailure
Definition: hcf_data_container.h:59
bool NewCycle
Definition: hcf_data_container.h:60
double Sth
Definition: hcf_data_container.h:58
double WohlerStress
Definition: hcf_data_container.h:57
double B0
Definition: hcf_data_container.h:54
unsigned int LocalNumberOfCycles
Definition: hcf_data_container.h:53
bool MinIndicator
Definition: hcf_data_container.h:47
double MaxStress
Definition: hcf_data_container.h:44
double Alphat
Definition: hcf_data_container.h:61
Vector PreviousStresses
Definition: hcf_data_container.h:48
double ReversionFactorRelativeError
Definition: hcf_data_container.h:50
double PreviousMinStress
Definition: hcf_data_container.h:56
double ReversionFactor
Definition: hcf_data_container.h:63
unsigned int GlobalNumberOfCycles
Definition: hcf_data_container.h:52
double MinStress
Definition: hcf_data_container.h:45
double MaxStressRelativeError
Definition: hcf_data_container.h:51
double FatigueReductionFactor
Definition: hcf_data_container.h:49
bool MaxIndicator
Definition: hcf_data_container.h:46