32 #include "addToRunTimeSelectionTable.H"
33 #include "volFields.H"
45 const DimensionedField<vector, volMesh>& iF)
46 : fixedGradientFvPatchVectorField(
p, iF),
47 traction_(
p.size(), Zero),
48 pressure_(
p.size(), 0.0)
50 fvPatchVectorField::operator=(patchInternalField());
58 const DimensionedField<vector, volMesh>& iF,
59 const fvPatchFieldMapper& mapper)
60 : fixedGradientFvPatchVectorField(tdpvf,
p, iF, mapper),
61 traction_(tdpvf.traction_, mapper),
62 pressure_(tdpvf.pressure_, mapper)
70 const DimensionedField<vector, volMesh>& iF,
71 const dictionary& dict)
72 : fixedGradientFvPatchVectorField(
p, iF),
73 traction_(
"traction", dict,
p.size()),
74 pressure_(
"pressure", dict,
p.size())
76 fvPatchVectorField::operator=(patchInternalField());
83 : fixedGradientFvPatchVectorField(tdpvf),
84 traction_(tdpvf.traction_),
85 pressure_(tdpvf.pressure_)
92 const DimensionedField<vector, volMesh>& iF)
93 : fixedGradientFvPatchVectorField(tdpvf, iF),
94 traction_(tdpvf.traction_),
95 pressure_(tdpvf.pressure_)
102 const fvPatchFieldMapper& m)
105 fixedGradientFvPatchVectorField::autoMap(m);
106 traction_.autoMap(m);
107 pressure_.autoMap(m);
112 const fvPatchVectorField& ptf,
113 const labelList& addr)
116 fixedGradientFvPatchVectorField::rmap(ptf, addr);
119 refCast<const tractionDisplacementFvPatchVectorField>(ptf);
121 traction_.rmap(dmptf.traction_, addr);
122 pressure_.rmap(dmptf.pressure_, addr);
133 const dictionary& mechanicalProperties =
134 db().lookupObject<IOdictionary>(
"mechanicalProperties");
136 const fvPatchField<scalar>&
rho =
137 patch().lookupPatchField<volScalarField, scalar>(
"solid:rho");
139 const fvPatchField<scalar>& rhoE =
140 patch().lookupPatchField<volScalarField, scalar>(
"E");
142 const fvPatchField<scalar>& nu =
143 patch().lookupPatchField<volScalarField, scalar>(
"solid:nu");
145 scalarField E(rhoE /
rho);
146 scalarField
mu(E / (2.0 * (1.0 + nu)));
147 scalarField
lambda(nu * E / ((1.0 + nu) * (1.0 - 2.0 * nu)));
149 Switch planeStress(mechanicalProperties.lookup(
"planeStress"));
153 lambda = nu * E / ((1.0 + nu) * (1.0 - nu));
156 scalarField twoMuLambda(2 *
mu +
lambda);
158 vectorField n(patch().nf());
164 const fvPatchField<tensor>&
gradD =
165 patch().lookupPatchField<volTensorField, tensor>(
"gradD");
166 gradient() = ((traction_ - pressure_ * n) /
rho
171 fixedGradientFvPatchVectorField::updateCoeffs();
176 fvPatchVectorField::write(os);
177 traction_.writeEntry(
"traction", os);
178 pressure_.writeEntry(
"pressure", os);
179 writeEntry(
"value", os);