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.
qs_vms_residual_derivatives.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: Suneth Warnakulasuriya
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "containers/variable.h"
21 #include "geometries/geometry.h"
24 #include "includes/node.h"
25 #include "includes/process_info.h"
28 
29 // Application includes
33 
34 namespace Kratos
35 {
38 
48 template <unsigned int TDim, unsigned int TNumNodes>
50 {
51 public:
54 
55  using IndexType = std::size_t;
56 
57  using NodeType = Node;
58 
60 
62 
63  static constexpr IndexType TBlockSize = TDim + 1;
64 
66  constexpr static IndexType TStrainSize = (TDim - 1) * 3; // 3 in 2D, 6 in 3D
67 
68  constexpr static IndexType TElementLocalSize = TBlockSize * TNumNodes;
69 
70  constexpr static IndexType TNN = TNumNodes;
71 
73 
75 
77 
79 
81 
85 
86  static void Check(
87  const Element& rElement,
88  const ProcessInfo& rProcessInfo);
89 
91 
95 
104  class QSVMSResidualData;
105 
109 
117  {
118  public:
121 
122  constexpr static IndexType NumNodes = TNumNodes;
123 
124  constexpr static IndexType BlockSize = TBlockSize;
125 
129 
131  VectorF& rResidual,
132  QSVMSResidualData& rData,
133  const double W,
134  const Vector& rN,
135  const Matrix& rdNdX) const;
136 
138 
139  private:
142 
143  void static AddViscousTerms(
144  QSVMSResidualData& rData,
145  VectorF& rResidual,
146  const double W);
147 
149  };
150 
159  template<class TDerivativesType>
161  {
162  public:
165 
166  constexpr static IndexType NumNodes = TNumNodes;
167 
168  constexpr static IndexType BlockSize = TBlockSize;
169 
170  constexpr static IndexType TDerivativeDimension = TDerivativesType::TDerivativeDimension;
171 
172  constexpr static IndexType ComponentIndex = TDerivativesType::ComponentIndex;
173 
177 
196  VectorF& rResidualDerivative,
197  QSVMSResidualData& rData,
198  const int NodeIndex,
199  const double W,
200  const Vector& rN,
201  const Matrix& rdNdX,
202  const double WDerivative,
203  const double DetJDerivative,
204  const Matrix& rdNdXDerivative,
205  const double MassTermsDerivativesWeight = 1.0) const
206  {
207  rResidualDerivative.clear();
208 
209  constexpr double u_factor = TDerivativesType::VelocityDerivativeFactor;
210  constexpr double p_factor = TDerivativesType::PressureDerivativeFactor;
211 
212  const auto& r_geometry = rData.mpElement->GetGeometry();
213 
214  const TDerivativesType derivatives_type(
215  NodeIndex, r_geometry, W, rN, rdNdX,
216  WDerivative, DetJDerivative, rdNdXDerivative);
217 
218  const auto& velocity_derivative = derivatives_type.CalculateEffectiveVelocityDerivative(rData.mVelocity);
219  const auto& element_length_derivative = derivatives_type.CalculateElementLengthDerivative(rData.mElementSize);
220  derivatives_type.CalculateStrainRateDerivative(rData.mStrainRateDerivative, rData.mNodalVelocity);
221 
222  // compute viscous term derivative
223  double effective_viscosity_derivative;
224 
225  // calculate derivative contributions w.r.t. current derivative variable. Derivative variables are
226  // assumed be independent of each other, so no cross derivative terms are there. Hence
227  // it is only sufficient to derrive w.r.t. current derivative variable.
228  rData.mpConstitutiveLaw->CalculateDerivative(rData.mConstitutiveLawValues, EFFECTIVE_VISCOSITY, derivatives_type.GetDerivativeVariable(), effective_viscosity_derivative);
229  effective_viscosity_derivative *= rN[NodeIndex];
230 
231  // calculate derivative contributions w.r.t. its dependent variable gradients. Dependent variable gradients
232  // may be dependent of each other. therefore it is required to calculate derivatives w.r.t. gradients of
233  // all dependent variables.
234  double effective_viscosity_derivative_value;
235  ArrayD derivative_variable_gradient;
236  const auto& r_effective_viscosity_dependent_variables = derivatives_type.GetEffectiveViscosityDependentVariables();
237  for (const auto& r_effective_viscosity_dependent_variable : r_effective_viscosity_dependent_variables) {
238  // these variables always needs to be scalars (eg. VELOCITY_X)
239  const auto& r_derivative_variable = std::get<0>(r_effective_viscosity_dependent_variable);
240  FluidCalculationUtilities::EvaluateGradientInPoint(rData.mpElement->GetGeometry(), rdNdXDerivative, std::tie(derivative_variable_gradient, r_derivative_variable));
241 
242  // this is a list of gradient component variables. This list also should only contain scalar variables (eg. VELOCITY_GRADIENT_TENSOR_XX)
243  const auto& r_effective_viscosity_dependent_variable_gradient_component_list = std::get<1>(r_effective_viscosity_dependent_variable);
244  for (IndexType i = 0; i < TDim; ++i) {
245  rData.mpConstitutiveLaw->CalculateDerivative(rData.mConstitutiveLawValues, EFFECTIVE_VISCOSITY, *r_effective_viscosity_dependent_variable_gradient_component_list[i], effective_viscosity_derivative_value);
246  effective_viscosity_derivative += effective_viscosity_derivative_value * (rdNdX(NodeIndex, i) * (r_derivative_variable == derivatives_type.GetDerivativeVariable()));
247  effective_viscosity_derivative += effective_viscosity_derivative_value * (derivative_variable_gradient[i]);
248  }
249  }
250 
251  const double velocity_norm_derivative = CalculateNormDerivative(
252  rData.mConvectiveVelocityNorm, rData.mConvectiveVelocity, velocity_derivative);
253 
254  double tau_one_derivative, tau_two_derivative;
256  tau_one_derivative, tau_two_derivative, rData.mTauOne,
257  rData.mDensity, rData.mDynamicTau, rData.mDeltaTime,
258  rData.mElementSize, element_length_derivative,
259  rData.mEffectiveViscosity, effective_viscosity_derivative,
260  rData.mConvectiveVelocityNorm, velocity_norm_derivative);
261 
262  ArrayD pressure_gradient_derivative;
263  BoundedMatrix<double, TDim, TDim> velocity_gradient_derivative;
265  r_geometry, rdNdXDerivative,
266  std::tie(pressure_gradient_derivative, PRESSURE),
267  std::tie(velocity_gradient_derivative, VELOCITY));
268  for (IndexType l = 0; l < TDim; ++l) {
269  pressure_gradient_derivative[l] += rdNdX(NodeIndex, l) * p_factor;
270  }
271  row(velocity_gradient_derivative, ComponentIndex) += row(rdNdX, NodeIndex) * u_factor;
272 
273  double velocity_dot_nabla_derivative = 0.0;
274  for (IndexType a = 0; a < TNumNodes; ++a) {
275  for (IndexType i = 0; i < TDim; ++i) {
276  velocity_dot_nabla_derivative += rData.mNodalVelocity(a, i) * rdNdXDerivative(a, i);
277  }
278  }
279 
280  const ArrayD effective_velocity_derivative_dot_velocity_gradient = prod(rData.mVelocityGradient, velocity_derivative);
281  const ArrayD effective_velocity_dot_velocity_gradient_derivative = prod(velocity_gradient_derivative, rData.mConvectiveVelocity);
282  const VectorN convective_velocity_derivative_dot_dn_dx = prod(rdNdX, velocity_derivative);
283  const VectorN relaxed_acceleration_dot_dn_dx_derivative = prod(rdNdXDerivative, rData.mRelaxedAcceleration);
284  const VectorN convective_velocity_dot_dn_dx_derivative = prod(rdNdXDerivative, rData.mConvectiveVelocity);
285  const VectorN effective_velocity_derivative_dot_velocity_gradient_dot_shape_gradient = prod(rdNdX, effective_velocity_derivative_dot_velocity_gradient);
286  const VectorN effective_velocity_dot_velocity_gradient_derivative_dot_shape_gradient = prod(rdNdX, effective_velocity_dot_velocity_gradient_derivative);
287  const VectorN effective_velocity_dot_velocity_gradient_dot_shape_gradient_derivative = prod(rdNdXDerivative, rData.mEffectiveVelocityDotVelocityGradient);
288  const VectorN pressure_gradient_derivative_dot_shape_gradient = prod(rdNdX, pressure_gradient_derivative);
289  const VectorN pressure_gradient_dot_shape_gradient_derivative = prod(rdNdXDerivative, rData.mPressureGradient);
290 
291  // TODO: Needs implementation for OSS projections
292  const ArrayD momentum_projection_derivative = ZeroVector(TDim);
293  const double mass_projection_derivative = 0.0;
294 
295  for (IndexType a = 0; a < TNumNodes; ++a) {
296  const IndexType row = a * TBlockSize;
297 
298  double forcing_derivative = 0.0;
299  for (IndexType i = 0; i < TDim; ++i) {
300 
301  double value = 0.0;
302 
303  // Adding RHS derivative terms
304  value += rData.mDensity * W * tau_one_derivative * rData.mConvectiveVelocityDotDnDx[a] * rData.mBodyForce[i];
305  value += rData.mDensity * W * rData.mTauOne * convective_velocity_derivative_dot_dn_dx[a] * rData.mBodyForce[i];
306  value += rData.mDensity * W * rData.mTauOne * convective_velocity_dot_dn_dx_derivative[a] * rData.mBodyForce[i];
307 
308  value -= rData.mDensity * W * tau_one_derivative * rData.mConvectiveVelocityDotDnDx[a] * rData.mMomentumProjection[i];
309  value -= rData.mDensity * W * rData.mTauOne * convective_velocity_derivative_dot_dn_dx[a] * rData.mMomentumProjection[i];
310  value -= rData.mDensity * W * rData.mTauOne * convective_velocity_dot_dn_dx_derivative[a] * rData.mMomentumProjection[i];
311  value -= rData.mDensity * W * rData.mTauOne * rData.mConvectiveVelocityDotDnDx[a] * momentum_projection_derivative[i];
312 
313  value -= W * tau_two_derivative * rdNdX(a, i) * rData.mMassProjection;
314  value -= W * rData.mTauTwo * rdNdXDerivative(a, i) * rData.mMassProjection;
315  value -= W * rData.mTauTwo * rdNdX(a, i) * mass_projection_derivative;
316 
317  forcing_derivative += rdNdXDerivative(a, i) * rData.mBodyForce[i];
318  forcing_derivative -= rdNdXDerivative(a, i) * rData.mMomentumProjection[i];
319  forcing_derivative -= rdNdX(a, i) * momentum_projection_derivative[i];
320 
321  // Adding LHS derivative terms
322  value -= W * rData.mDensity * rN[a] * effective_velocity_derivative_dot_velocity_gradient[i];
323  value -= W * rData.mDensity * rN[a] * effective_velocity_dot_velocity_gradient_derivative[i];
324 
325  value -= W * rData.mDensity * convective_velocity_derivative_dot_dn_dx[a] * rData.mTauOne * rData.mDensity * rData.mEffectiveVelocityDotVelocityGradient[i];
326  value -= W * rData.mDensity * convective_velocity_dot_dn_dx_derivative[a] * rData.mTauOne * rData.mDensity * rData.mEffectiveVelocityDotVelocityGradient[i];
327  value -= W * rData.mDensity * rData.mConvectiveVelocityDotDnDx[a] * tau_one_derivative * rData.mDensity * rData.mEffectiveVelocityDotVelocityGradient[i];
328  value -= W * rData.mDensity * rData.mConvectiveVelocityDotDnDx[a] * rData.mTauOne * rData.mDensity * effective_velocity_derivative_dot_velocity_gradient[i];
329  value -= W * rData.mDensity * rData.mConvectiveVelocityDotDnDx[a] * rData.mTauOne * rData.mDensity * effective_velocity_dot_velocity_gradient_derivative[i];
330 
331  value -= W * tau_one_derivative * rData.mDensity * rData.mConvectiveVelocityDotDnDx[a] * rData.mPressureGradient[i];
332  value -= W * rData.mTauOne * rData.mDensity * convective_velocity_derivative_dot_dn_dx[a] * rData.mPressureGradient[i];
333  value -= W * rData.mTauOne * rData.mDensity * convective_velocity_dot_dn_dx_derivative[a] * rData.mPressureGradient[i];
334  value -= W * rData.mTauOne * rData.mDensity * rData.mConvectiveVelocityDotDnDx[a] * pressure_gradient_derivative[i];
335 
336  value += W * rdNdXDerivative(a, i) * rData.mPressure;
337  value += W * rdNdX(a, i) * rN[NodeIndex] * p_factor;
338 
339  value -= W * tau_two_derivative * rdNdX(a, i) * rData.mVelocityDotNabla;
340  value -= W * rData.mTauTwo * rdNdXDerivative(a, i) * rData.mVelocityDotNabla;
341  value -= W * rData.mTauTwo * rdNdX(a, i) * velocity_dot_nabla_derivative;
342  value -= W * rData.mTauTwo * rdNdX(a, i) * rdNdX(NodeIndex, ComponentIndex) * u_factor;
343 
344  // Adding Mass term derivatives
345 
346  value -= W * tau_one_derivative * rData.mDensity * rData.mDensity * rData.mConvectiveVelocityDotDnDx[a] * rData.mRelaxedAcceleration[i] * MassTermsDerivativesWeight;
347  value -= W * rData.mTauOne * rData.mDensity * rData.mDensity * convective_velocity_derivative_dot_dn_dx[a] * rData.mRelaxedAcceleration[i] * MassTermsDerivativesWeight;
348  value -= W * rData.mTauOne * rData.mDensity * rData.mDensity * convective_velocity_dot_dn_dx_derivative[a] * rData.mRelaxedAcceleration[i] * MassTermsDerivativesWeight;
349 
350  rResidualDerivative[row + i] += value;
351  }
352 
353  double value = 0.0;
354 
355  const double forcing = rData.mBodyForceDotDnDx[a] - rData.mMomentumProjectionDotDnDx[a];
356  value += W * tau_one_derivative * forcing;
357  value += W * rData.mTauOne * forcing_derivative;
358 
359  value -= W * tau_one_derivative * rData.mDensity * rData.mEffectiveVelocityDotVelocityGradientDotShapeGradient[a];
360  value -= W * rData.mTauOne * rData.mDensity * effective_velocity_derivative_dot_velocity_gradient_dot_shape_gradient[a];
361  value -= W * rData.mTauOne * rData.mDensity * effective_velocity_dot_velocity_gradient_derivative_dot_shape_gradient[a];
362  value -= W * rData.mTauOne * rData.mDensity * effective_velocity_dot_velocity_gradient_dot_shape_gradient_derivative[a];
363 
364  value -= W * rN[a] * velocity_dot_nabla_derivative;
365  value -= W * rN[a] * rdNdX(NodeIndex, ComponentIndex) * u_factor;
366 
367  value -= W * tau_one_derivative * rData.mPressureGradientDotDnDx[a];
368  value -= W * rData.mTauOne * pressure_gradient_derivative_dot_shape_gradient[a];
369  value -= W * rData.mTauOne * pressure_gradient_dot_shape_gradient_derivative[a];
370 
371  // Adding mass term derivatives
372  value -= W * tau_one_derivative * rData.mDensity * rData.mRelaxedAccelerationDotDnDx[a] * MassTermsDerivativesWeight;
373  value -= W * rData.mTauOne * rData.mDensity * relaxed_acceleration_dot_dn_dx_derivative[a] * MassTermsDerivativesWeight;
374 
375  rResidualDerivative[row + TDim] += value;
376  }
377 
378  mResidualsContributions.AddGaussPointResidualsContributions(
379  rResidualDerivative, rData, WDerivative, rN, rdNdX);
380 
381  // calculate shear stress derivative.
382  const auto& r_strain_rate_variables = QSVMSDerivativeUtilities<TDim>::GetStrainRateVariables();
383  Vector value;
384  rData.mShearStressDerivative.clear();
385 
386  // calculate shear stress derivatives w.r.t. strain rate
387  for (IndexType i = 0; i < TStrainSize; ++i) {
388  rData.mpConstitutiveLaw->CalculateDerivative(rData.mConstitutiveLawValues, CAUCHY_STRESS_VECTOR, *r_strain_rate_variables[i], value);
389  noalias(rData.mShearStressDerivative) += value * rData.mStrainRateDerivative[i];
390  }
391  // calculate shear stress derivatives w.r.t. effective viscosity
392  rData.mpConstitutiveLaw->CalculateDerivative(rData.mConstitutiveLawValues, CAUCHY_STRESS_VECTOR, EFFECTIVE_VISCOSITY, value);
393  noalias(rData.mShearStressDerivative) += value * effective_viscosity_derivative;
394 
395  AddViscousDerivative(rData, rResidualDerivative, NodeIndex,
396  W, rN, rdNdX, WDerivative,
397  DetJDerivative, rdNdXDerivative);
398  }
399 
401 
402  private:
405 
406  ResidualsContributions mResidualsContributions;
407 
411 
425  void static AddViscousDerivative(
426  QSVMSResidualData& rData,
427  VectorF& rResidualDerivative,
428  const int NodeIndex,
429  const double W,
430  const Vector& rN,
431  const Matrix& rdNdX,
432  const double WDerivative,
433  const double DetJDerivative,
434  const Matrix& rdNdXDerivative)
435  {
437  FluidElementUtilities<TNumNodes>::GetStrainMatrix(rdNdXDerivative, strain_matrix_derivative);
438 
439  const VectorF& rhs_contribution_derivative =
440  prod(trans(rData.mStrainMatrix), rData.mShearStressDerivative) +
441  prod(trans(strain_matrix_derivative), rData.mShearStress);
442 
443  noalias(rResidualDerivative) -= rhs_contribution_derivative * W;
444  }
445 
447  };
448 
456  template<unsigned int TComponentIndex>
458  {
459  public:
462 
463  constexpr static IndexType NumNodes = TNumNodes;
464 
465  constexpr static IndexType BlockSize = TBlockSize;
466 
470 
472  VectorF& rResidualDerivative,
473  QSVMSResidualData& rData,
474  const int NodeIndex,
475  const double W,
476  const Vector& rN,
477  const Matrix& rdNdX) const;
478 
480  };
481 
483  {
484  public:
487 
488  static constexpr IndexType TBlockSize = TDim + 1;
489 
490  static constexpr IndexType TLNumNodes = TNN;
491 
493 
497 
498  void Initialize(
499  const Element& rElement,
500  ConstitutiveLaw& rConstitutiveLaw,
501  const ProcessInfo& rProcessInfo);
502 
504  const double W,
505  const Vector& rN,
506  const Matrix& rdNdX);
507 
509  private:
512 
513  const Element* mpElement;
514  ConstitutiveLaw* mpConstitutiveLaw;
515 
516  // Primal data
517  int mOSSSwitch;
518  double mDensity;
519  double mConvectiveVelocityNorm;
520  double mEffectiveViscosity;
521  double mDeltaTime;
522  double mDynamicTau;
523  double mTauOne;
524  double mTauTwo;
525  double mElementSize;
526  double mMassProjection;
527  double mDynamicViscosity;
528  double mPressure;
529  double mVelocityDotNabla;
530 
531  ArrayD mBodyForce;
532  ArrayD mVelocity;
533  ArrayD mMeshVelocity;
534  ArrayD mRelaxedAcceleration;
535  ArrayD mConvectiveVelocity;
536  ArrayD mMomentumProjection;
537  ArrayD mPressureGradient;
538  ArrayD mEffectiveVelocityDotVelocityGradient;
539 
540  VectorN mConvectiveVelocityDotDnDx;
541  VectorN mRelaxedAccelerationDotDnDx;
542  VectorN mEffectiveVelocityDotVelocityGradientDotShapeGradient;
543  VectorN mBodyForceDotDnDx;
544  VectorN mMomentumProjectionDotDnDx;
545  VectorN mPressureGradientDotDnDx;
546  VectorN mNodalPressure;
547  MatrixND mNodalVelocity;
548  MatrixND mNodalMeshVelocity;
549  MatrixND mNodalEffectiveVelocity;
550  MatrixDD mVelocityGradient;
551  MatrixDD mMeshVelocityGradient;
552  MatrixDD mEffectiveVelocityGradient;
553  BoundedVector<double, TElementLocalSize> mViscousTermRHSContribution;
554 
555  ConstitutiveLaw::Parameters mConstitutiveLawValues;
557  Vector mStrainRate;
558  Vector mShearStress;
559  Matrix mC;
560 
561  // Sotring this derivatives also in primal data container
562  // since all the matrices and vectors needs to be initialized
563  // in the heap, therefore to avoid re-reserving memory for each derivative
564  Vector mStrainRateDerivative;
565  Vector mShearStressDerivative;
566 
570 
571  template<class TDerivativesType>
572  friend class VariableDerivatives;
573 
574  template<unsigned int TComponentIndex>
575  friend class SecondDerivatives;
576 
578 
580  };
581 
585 
586  static double CalculateNormDerivative(
587  const double ValueNorm,
588  const Vector& Value,
589  const Vector& ValueDerivative);
590 
591  static void CalculateTau(
592  double& TauOne,
593  double& TauTwo,
594  const double ElementSize,
595  const double Density,
596  const double Viscosity,
597  const double VelocityNorm,
598  const double DynamicTau,
599  const double DeltaTime);
600 
601  static void CalculateTauDerivative(
602  double& TauOneDerivative,
603  double& TauTwoDerivative,
604  const double TauOne,
605  const double Density,
606  const double DynamicTau,
607  const double DeltaTime,
608  const double ElementSize,
609  const double ElementSizeDerivative,
610  const double Viscosity,
611  const double ViscosityDerivative,
612  const double VelocityNorm,
613  const double VelocityNormDerivative);
614 
615  static void InitializeConstitutiveLaw(
616  ConstitutiveLaw::Parameters& rParameters,
617  Vector& rStrainVector,
618  Vector& rStressVector,
619  Matrix& rConstitutiveMatrix,
620  const GeometryType& rGeometry,
621  const PropertiesType& rProperties,
622  const ProcessInfo& rProcessInfo);
623 
625 };
626 
627 } // namespace Kratos
Definition: constitutive_law.h:47
virtual void CalculateDerivative(Parameters &rParameterValues, const Variable< double > &rFunctionVariable, const Variable< double > &rDerivativeVariable, double &rOutput)
Calculates derivatives of a given function.
Definition: constitutive_law.cpp:450
Base class for all Elements.
Definition: element.h:60
Properties PropertiesType
Definition: element.h:80
static void GetStrainMatrix(const ShapeDerivatives2DType &rDNDX, BoundedMatrix< double, VoigtVector2DSize, 3 *TNumNodes > &rStrainMatrix)
Definition: fluid_element_utilities.cpp:23
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
IntegrationMethod
Definition: geometry_data.h:76
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
void clear()
Definition: amatrix_interface.h:284
This class defines the node.
Definition: node.h:65
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
static const std::array< const Variable< double > *, TStrainSize > GetStrainRateVariables()
Definition: qs_vms_residual_derivatives.h:483
static constexpr IndexType TResidualSize
Definition: qs_vms_residual_derivatives.h:492
void CalculateGaussPointData(const double W, const Vector &rN, const Matrix &rdNdX)
Definition: qs_vms_residual_derivatives.cpp:248
static constexpr IndexType TLNumNodes
Definition: qs_vms_residual_derivatives.h:490
void Initialize(const Element &rElement, ConstitutiveLaw &rConstitutiveLaw, const ProcessInfo &rProcessInfo)
Definition: qs_vms_residual_derivatives.cpp:186
static constexpr IndexType TBlockSize
Definition: qs_vms_residual_derivatives.h:488
Computes residual contributions.
Definition: qs_vms_residual_derivatives.h:117
constexpr static IndexType NumNodes
Definition: qs_vms_residual_derivatives.h:122
constexpr static IndexType BlockSize
Definition: qs_vms_residual_derivatives.h:124
void AddGaussPointResidualsContributions(VectorF &rResidual, QSVMSResidualData &rData, const double W, const Vector &rN, const Matrix &rdNdX) const
Definition: qs_vms_residual_derivatives.cpp:87
Computes second derivatives of the QS VMS residual.
Definition: qs_vms_residual_derivatives.h:458
constexpr static IndexType BlockSize
Definition: qs_vms_residual_derivatives.h:465
void CalculateGaussPointResidualsDerivativeContributions(VectorF &rResidualDerivative, QSVMSResidualData &rData, const int NodeIndex, const double W, const Vector &rN, const Matrix &rdNdX) const
Definition: qs_vms_residual_derivatives.cpp:158
constexpr static IndexType NumNodes
Definition: qs_vms_residual_derivatives.h:463
Computes QS VMS residual derivative residuals for given variable.
Definition: qs_vms_residual_derivatives.h:161
constexpr static IndexType BlockSize
Definition: qs_vms_residual_derivatives.h:168
constexpr static IndexType NumNodes
Definition: qs_vms_residual_derivatives.h:166
constexpr static IndexType ComponentIndex
Definition: qs_vms_residual_derivatives.h:172
void CalculateGaussPointResidualsDerivativeContributions(VectorF &rResidualDerivative, QSVMSResidualData &rData, const int NodeIndex, const double W, const Vector &rN, const Matrix &rdNdX, const double WDerivative, const double DetJDerivative, const Matrix &rdNdXDerivative, const double MassTermsDerivativesWeight=1.0) const
Computes gauss point residual derivatives for given NodeIndex.
Definition: qs_vms_residual_derivatives.h:195
constexpr static IndexType TDerivativeDimension
Definition: qs_vms_residual_derivatives.h:170
Computes the QSVMS residual derivatives.
Definition: qs_vms_residual_derivatives.h:50
static void InitializeConstitutiveLaw(ConstitutiveLaw::Parameters &rParameters, Vector &rStrainVector, Vector &rStressVector, Matrix &rConstitutiveMatrix, const GeometryType &rGeometry, const PropertiesType &rProperties, const ProcessInfo &rProcessInfo)
Definition: qs_vms_residual_derivatives.cpp:387
static void CalculateTauDerivative(double &TauOneDerivative, double &TauTwoDerivative, const double TauOne, const double Density, const double DynamicTau, const double DeltaTime, const double ElementSize, const double ElementSizeDerivative, const double Viscosity, const double ViscosityDerivative, const double VelocityNorm, const double VelocityNormDerivative)
Definition: qs_vms_residual_derivatives.cpp:354
typename Element::PropertiesType PropertiesType
Definition: qs_vms_residual_derivatives.h:61
std::size_t IndexType
Definition: qs_vms_residual_derivatives.h:55
static void CalculateTau(double &TauOne, double &TauTwo, const double ElementSize, const double Density, const double Viscosity, const double VelocityNorm, const double DynamicTau, const double DeltaTime)
Definition: qs_vms_residual_derivatives.cpp:333
constexpr static IndexType TElementLocalSize
Definition: qs_vms_residual_derivatives.h:68
constexpr static IndexType TNN
Definition: qs_vms_residual_derivatives.h:70
static void Check(const Element &rElement, const ProcessInfo &rProcessInfo)
Definition: qs_vms_residual_derivatives.cpp:35
constexpr static IndexType TStrainSize
Size of the strain and stress vectors (in Voigt notation) for the formulation.
Definition: qs_vms_residual_derivatives.h:66
static double CalculateNormDerivative(const double ValueNorm, const Vector &Value, const Vector &ValueDerivative)
Definition: qs_vms_residual_derivatives.cpp:320
static constexpr IndexType TBlockSize
Definition: qs_vms_residual_derivatives.h:63
static GeometryData::IntegrationMethod GetIntegrationMethod()
Definition: qs_vms_residual_derivatives.cpp:80
static void EvaluateGradientInPoint(const GeometryType &rGeometry, const Matrix &rShapeFunctionDerivatives, const int Step, const TRefVariableValuePairArgs &... rValueVariablePairs)
Evaluates gradients of given list of variable pairs at gauss point locations at step.
Definition: fluid_calculation_utilities.h:196
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
a
Definition: generate_stokes_twofluid_element.py:77
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17
Definition: constitutive_law.h:189