Forward compatibility: flex
[foam-extend-3.2.git] / src / solidModels / arbitraryCrack / solidCohesiveFixedModeMix / solidCohesiveFixedModeMixFvPatchVectorField.H
blobd3296bed3cef0121348f271084866fa18c763927
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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/>.
24 Class
25     solidCohesiveFixedModeMixFvPatchVectorField
27 Description
28     Cohesive law fv patch field for arbitrary crack procedure,
29     where the mode mixity is fixed of a damaged face is fixed
30     at the initiation mode mixity.
31     Fixing the mode-mixity is only a valid approach when the
32     it is clear that the mode-mixity does not change or if the
33     damage zones are small.
35     This boundary was originally called cohesiveLawFvPatchVectorField.
36     There are a couple of changes:
37     cohesive law is looked up from constitutive model;
38     only Dugdale cohesive law is allowed.
40     This method is based on:
41     Camacho GT and Ortiz M, Computational modelling of impact damage in
42     brittle materials, Int J Solids Structures, 33(20-22):2899-2938, 1996.
44 Author
45     Zeljko Tukovic, FSB Zagreb.  All rights reserved.
47 SourceFiles
48     solidCohesiveFixedModeMixFvPatchVectorField.C
50 \*---------------------------------------------------------------------------*/
52 #ifndef solidCohesiveFixedModeMixFvPatchVectorField_H
53 #define solidCohesiveFixedModeMixFvPatchVectorField_H
55 #include "fvPatchFields.H"
56 #include "directionMixedFvPatchFields.H"
57 #include "cohesiveFvPatch.H"
58 //#include "cohesiveLaw.H"
59 #include "Switch.H"
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 namespace Foam
66 /*---------------------------------------------------------------------------*\
67                    Class cohesiveLawFvPatch Declaration
68 \*---------------------------------------------------------------------------*/
70 class solidCohesiveFixedModeMixFvPatchVectorField
72     public directionMixedFvPatchVectorField
75     // Private Data
77         //- Name of the displacement field
78         const word fieldName_;
80         //- Name of rheology model
81         //const word rheologyName_;
83         //- Cohesive law
84         //cohesiveLaw* cohesiveLawPtr_;
86         //- Under-relaxation factor
87         scalar relaxationFactor_;
89         //- Current traction
90         vectorField traction_;
92         //- Current traction
93         vectorField initiationTraction_;
95         //- Current separation distance
96         vectorField separationDistance_;
98         //- Current separation distance
99         vectorField oldSeparationDistance_;
101         //- Current unloading separation distance
102         vectorField unloadingSeparationDistance_;
104         //- Minimal unloading relative separation distance
105         scalar minUnloadingSeparationDistance_;
107         //- Ratio between shear and normal critical traction
108         scalar beta_;
110         //- If yes, cohesive traction will be calculated
111         //  using old separation distance
112         Switch explicitSeparationDistance_;
114         //- If yes, contact procedure will be used to calculate
115         //  cohesive traction for the negative normal separation distance
116         Switch contact_;
118         //- Constant which determins slope of negative (contact)
119         //  part of the traction separation curve
120         scalar contactConstant_;
122         //- Current time index
123         label curTimeIndex_;
126 public:
128     //- Runtime type information
129     TypeName("solidCohesiveFixedModeMix");
132     // Constructors
134         //- Construct from patch and internal field
135         solidCohesiveFixedModeMixFvPatchVectorField
136         (
137             const fvPatch&,
138             const DimensionedField<vector, volMesh>&
139         );
141         //- Construct from patch, internal field and dictionary
142         solidCohesiveFixedModeMixFvPatchVectorField
143         (
144             const fvPatch&,
145             const DimensionedField<vector, volMesh>&,
146             const dictionary&
147         );
149         //- Construct by mapping given
150         //  solidCohesiveFixedModeMixFvPatchVectorField onto a new patch
151         solidCohesiveFixedModeMixFvPatchVectorField
152         (
153             const solidCohesiveFixedModeMixFvPatchVectorField&,
154             const fvPatch&,
155             const DimensionedField<vector, volMesh>&,
156             const fvPatchFieldMapper&
157         );
159         //- Construct as copy
160         solidCohesiveFixedModeMixFvPatchVectorField
161         (
162             const solidCohesiveFixedModeMixFvPatchVectorField&
163         );
165         //- Construct and return a clone
166         virtual tmp<fvPatchVectorField> clone() const
167         {
168             return tmp<fvPatchVectorField>
169             (
170                 new solidCohesiveFixedModeMixFvPatchVectorField(*this)
171             );
172         }
174         //- Construct as copy setting internal field reference
175         solidCohesiveFixedModeMixFvPatchVectorField
176         (
177             const solidCohesiveFixedModeMixFvPatchVectorField&,
178             const DimensionedField<vector, volMesh>&
179         );
181         //- Construct and return a clone setting internal field reference
182         virtual tmp<fvPatchVectorField> clone
183         (
184             const DimensionedField<vector, volMesh>& iF
185         ) const
186         {
187             return tmp<fvPatchVectorField>
188             (
189                 new solidCohesiveFixedModeMixFvPatchVectorField(*this, iF)
190             );
191         }
194     // Member functions
196         // Access
198             //- Return true if this patch field fixes a value.
199             //  Needed to check if a level has to be specified while solving
200             //  Poissons equations.
201             virtual bool fixesValue() const
202             {
203                 return false;
204             }
206             //- Return cohesive law
207             //const cohesiveLaw& law() const;
209             //- Return current traction
210             vectorField& initiationTraction()
211             {
212                 return initiationTraction_;
213             }
215             //- Return const reference to current traction
216             const vectorField& traction() const
217             {
218                 return traction_;
219             }
221             //- Return reference to current traction
222             vectorField& traction()
223             {
224                 return traction_;
225             }
227             //- Normal traction
228             //tmp<scalarField> normalTraction() const;
230             //- Relative separation distance
231             tmp<scalarField> relativeSeparationDistance() const;
233             //- Effective traction
234             //tmp<scalarField> effectiveTraction
235             //(
236             //    const vectorField& traction,
237             //    const vectorField& normal
238             //) const;
240             //- Effective traction
241             // scalar effectiveTraction
242             // (
243             //     const vector& traction,
244             //     const vector& normal
245             // ) const;
247             //- New faces
248             const scalar& beta() const
249             {
250                 return beta_;
251             }
254         // Mapping functions
256             //- Map (and resize as needed) from self given a mapping object
257             virtual void autoMap
258             (
259                 const fvPatchFieldMapper&
260             );
262             //- Reverse map the given fvPatchField onto this fvPatchField
263             virtual void rmap
264             (
265                 const fvPatchVectorField&,
266                 const labelList&
267             );
270         //- Update the coefficients associated with the patch field
271         virtual void updateCoeffs();
273         //- Write
274         virtual void write(Ostream&) const;
277     // Member operators
279         virtual void operator=(const fvPatchVectorField&) {}
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285 } // End namespace Foam
287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
289 #endif
291 // ************************************************************************* //