1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 solidCohesiveFvPatchVectorField
28 Cohesive law fv patch field for arbitrary crack procedure,
29 where the mode mixity is allowed to vary depending on how
32 This procedure allows sigmaMax, tauMax, GIc, and GIIc
33 to be independently specified.
35 The cohesive law surface field is looked up from rheology.
37 The dissipated fracture energy is constantly monitored, by
42 based on original Tukovic cohesive law boundary condition.
45 solidCohesiveFvPatchVectorField.C
47 \*---------------------------------------------------------------------------*/
49 #ifndef solidCohesiveFvPatchVectorField_H
50 #define solidCohesiveFvPatchVectorField_H
52 #include "fvPatchFields.H"
53 #include "directionMixedFvPatchFields.H"
54 #include "nonLinearGeometry.H"
55 #include "cohesiveFvPatch.H"
57 #include "tractionBoundaryGradient.H"
58 #include "NamedEnum.H"
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 /*---------------------------------------------------------------------------*\
66 Class solidCohesiveFvPatch Declaration
67 \*---------------------------------------------------------------------------*/
69 class solidCohesiveFvPatchVectorField
71 public directionMixedFvPatchVectorField
76 //- Name of the displacement field
77 const word fieldName_;
79 //- Cohesive law - now part of constitutiveModel
80 //cohesiveZoneModel* cohesiveZoneModelPtr_;
82 //- Under-relaxation factor
83 scalar relaxationFactor_;
86 vectorField traction_;
88 //- Minimal unloading relative separation distance
89 //scalar minUnloadingSeparationDistance_;
91 //- If yes, contact procedure will be used to calculate
92 // cohesive traction for the negative normal separation distance
95 //- if a face has cracked
96 //Field<bool> cracked_;
100 scalarField curTractionN_;
101 scalarField oldTractionN_;
102 scalarField curTractionS_;
103 scalarField oldTractionS_;
107 scalarField oldDeltaN_;
109 scalarField oldDeltaS_;
110 scalarField unloadingDeltaEff_;
113 scalarField currentGI_;
115 scalarField currentGII_;
119 //- Current time index
122 // Penalty factor and returning penalty factor
123 // for penalty contact
124 scalar* penaltyFactorPtr_;
125 scalar penaltyScale_;
126 scalar frictionCoeff_; // Coulomb friction coefficient
128 // If yes, cohesive traction will be calculated
129 // using old separation distance
130 Switch explicitSeparationDistance_;
131 scalarField curDeltaN_;
132 scalarField curDeltaS_;
134 // Global patch material field needed for multimaterial cohesive laws
135 bool updateGlobalPatchMaterials_;
136 scalarField globalPatchMaterials_;
138 //- Is it a non linear solver
139 nonLinearGeometry::nonLinearType nonLinear_;
141 //- if it is an orthropic solver
145 // Private member functions
148 void calcPenaltyFactor();
149 virtual scalar penaltyFactor()
151 if (!penaltyFactorPtr_)
156 return *penaltyFactorPtr_;
162 //- Runtime type information
163 TypeName("solidCohesive");
168 //- Construct from patch and internal field
169 solidCohesiveFvPatchVectorField
172 const DimensionedField<vector, volMesh>&
175 //- Construct from patch, internal field and dictionary
176 solidCohesiveFvPatchVectorField
179 const DimensionedField<vector, volMesh>&,
183 //- Construct by mapping given
184 // solidCohesiveFvPatchVectorField onto a new patch
185 solidCohesiveFvPatchVectorField
187 const solidCohesiveFvPatchVectorField&,
189 const DimensionedField<vector, volMesh>&,
190 const fvPatchFieldMapper&
193 //- Construct as copy
194 solidCohesiveFvPatchVectorField
196 const solidCohesiveFvPatchVectorField&
199 //- Construct and return a clone
200 virtual tmp<fvPatchVectorField> clone() const
202 return tmp<fvPatchVectorField>
204 new solidCohesiveFvPatchVectorField(*this)
208 //- Construct as copy setting internal field reference
209 solidCohesiveFvPatchVectorField
211 const solidCohesiveFvPatchVectorField&,
212 const DimensionedField<vector, volMesh>&
215 //- Construct and return a clone setting internal field reference
216 virtual tmp<fvPatchVectorField> clone
218 const DimensionedField<vector, volMesh>& iF
221 return tmp<fvPatchVectorField>
223 new solidCohesiveFvPatchVectorField(*this, iF)
232 //- Return true if this patch field fixes a value.
233 // Needed to check if a level has to be specified while solving
234 // Poissons equations.
235 virtual bool fixesValue() const
240 //- Return cohesive law
241 //const cohesiveZoneModel& law() const;
243 //- Return current traction
244 // const vectorField& traction() const
245 vectorField& traction()
251 //tmp<scalarField> normalTraction() const;
253 //- Relative separation distance
254 //tmp<scalarField> relativeSeparationDistance() const;
256 //- Effective traction
257 // tmp<scalarField> effectiveTraction
259 // const vectorField& traction,
260 // const vectorField& normal
263 //- Effective traction
264 // scalar effectiveTraction
266 // const vector& traction,
267 // const vector& normal
271 // const scalar& beta() const
276 //- crack and damage field for visualisation
277 //- cracked faces set to 2, damaged but not cracked set to 1
278 tmp<scalarField> crackingAndDamage() const;
280 //- G field for visualisation
281 tmp<scalarField> GI() const;
282 tmp<scalarField> GII() const;
284 //- print number of damaged and cracked faces
289 //- Map (and resize as needed) from self given a mapping object
292 const fvPatchFieldMapper&
295 //- Reverse map the given fvPatchField onto this fvPatchField
298 const fvPatchVectorField&,
303 //- Update the coefficients associated with the patch field
304 virtual void updateCoeffs();
307 virtual void write(Ostream&) const;
312 virtual void operator=(const fvPatchVectorField&) {}
316 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
318 } // End namespace Foam
320 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
324 // ************************************************************************* //