tractionDisplacementFvPatchVectorFieldTemplates.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2020-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
28 
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30 
31 template<class Type>
33 (
34  const Type& pressure
35 )
36 {
37  const label patchi = patch().index();
38 
40  db().lookupObject<solidDisplacementThermo>
41  (
42  physicalProperties::typeName
43  );
44 
45  const scalarField& E = thermo.E(patchi);
46  const scalarField& nu = thermo.nu(patchi);
47 
48  const scalarField mu(E/(2.0*(1.0 + nu)));
49  const scalarField lambda
50  (
51  thermo.planeStress()
52  ? nu*E/((1 + nu)*(1 - nu))
53  : nu*E/((1 + nu)*(1 - 2*nu))
54  );
55  const scalarField threeK
56  (
57  thermo.planeStress()
58  ? E/(1 - nu)
59  : E/(1 - 2*nu)
60  );
61 
62  const scalarField twoMuLambda(2*mu + lambda);
63 
64  const vectorField n(patch().nf());
65 
66  const fvPatchField<symmTensor>& sigmaD =
67  patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
68 
69  gradient() =
70  (
71  (traction_ - pressure*n)
72  + twoMuLambda*fvPatchField<vector>::snGrad() - (n & sigmaD)
73  )/twoMuLambda;
74 
75  if (thermo.thermalStress())
76  {
77  const scalarField& alphav = thermo.alphav(patchi);
78 
79  gradient() +=
80  n*threeK*alphav*thermo.T().boundaryField()[patchi]/twoMuLambda;
81  }
82 
83  fixedGradientFvPatchVectorField::updateCoeffs();
84 }
85 
86 
87 // ************************************************************************* //
label n
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
Fundamental solid thermodynamic properties.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
label patchi
dimensionedScalar lambda(viscosity->lookup("lambda"))
const dimensionedScalar mu
Atomic mass unit.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
VolField< symmTensor > volSymmTensorField
Definition: volFieldsFwd.H:67
fluidMulticomponentThermo & thermo
Definition: createFields.H:31