KirchhoffShell.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2019-2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "KirchhoffShell.H"
30 #include "fvPatchFields.H"
32 #include "subCycle.H"
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace regionModels
39 {
40 
41 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
42 
44 
46 
47 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
48 
49 bool KirchhoffShell::init(const dictionary& dict)
50 {
51  this->solution().readEntry("nNonOrthCorr", nNonOrthCorr_);
52  return true;
53 }
54 
55 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
56 
58 {
59  if (debug)
60  {
62  }
63 
64  const Time& time = primaryMesh().time();
65 
66  areaScalarField solidMass(rho()*h_);
67  areaScalarField solidD(D()/solidMass);
68 
69  // Save old times
72 
73  if (nSubCycles_ > 1)
74  {
75  // Restore the oldTime in sub-cycling
76  w_.oldTime() = w0_;
77  w_.oldTime().oldTime() = w00_;
80  }
81 
82  for
83  (
84  subCycleTime wSubCycle
85  (
86  const_cast<Time&>(time),
88  );
89  !(++wSubCycle).end();
90  )
91  {
92 
95 
96  faScalarMatrix wEqn
97  (
98  fam::d2dt2(w_)
99  + f1_*fam::ddt(w_)
100  - f0_*sqrt(solidD)*fac::ddt(laplaceW_)
101  + solidD*(laplace2W_ + f2_*fac::ddt(laplace2W_))
102  ==
103  ps_/solidMass
104  + faOptions()(solidMass, w_, dimLength/sqr(dimTime))
105  );
106 
107  faOptions().constrain(wEqn);
108 
109  wEqn.solve();
110 
111  if (wSubCycle.index() >= wSubCycle.nSubCycles())
112  {
113  // Cache oldTimes inside the sub-cycling
114  w0_ = w_.oldTime();
115  w00_ = w_.oldTime().oldTime();
118 
119  // Update shell acceleration
120  a_ = fac::d2dt2(w_);
121  }
122  }
123 
124  Info<< "ws_vibrationShell: "
125  << "min = " << min(w_).value() << ", "
126  << "max = " << max(w_).value() << endl;
127 
128  // Restore old time in main time
129  w_.oldTime() = w0;
130  w_.oldTime().oldTime() = w00;
131 
132  faOptions().correct(w_);
133 }
134 
135 
136 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
137 
139 (
140  const word& modelType,
141  const fvPatch& patch,
142  const dictionary& dict
143 )
144 :
145  vibrationShellModel(modelType, patch, dict),
146  f0_("f0", dimless, dict),
147  f1_("f1", inv(dimTime), dict),
148  f2_("f2", dimTime, dict),
149  nNonOrthCorr_(1),
150  nSubCycles_(1),
151  ps_
152  (
153  IOobject
154  (
155  "ps_" + regionName_,
156  primaryMesh().time().timeName(),
157  primaryMesh(),
160  ),
161  regionMesh(),
163  ),
164  h_
165  (
166  IOobject
167  (
168  "h_" + regionName_,
169  primaryMesh().time().timeName(),
170  primaryMesh(),
173  ),
174  regionMesh()
175  ),
176  laplaceW_
177  (
178  IOobject
179  (
180  "laplaceW_" + regionName_,
181  primaryMesh().time().timeName(),
182  primaryMesh(),
185  ),
186  regionMesh(),
188  ),
189  laplace2W_
190  (
191  IOobject
192  (
193  "laplace2W_" + regionName_,
194  primaryMesh().time().timeName(),
195  primaryMesh(),
198  ),
199  regionMesh(),
201  ),
202  w0_
203  (
204  IOobject
205  (
206  "w0_" + regionName_,
207  primaryMesh().time().timeName(),
208  primaryMesh(),
211  ),
212  regionMesh(),
214  ),
215  w00_
216  (
217  IOobject
218  (
219  "w00_" + regionName_,
220  primaryMesh().time().timeName(),
221  primaryMesh(),
224  ),
225  regionMesh(),
227  ),
228  laplaceW0_
229  (
230  IOobject
231  (
232  "laplaceW0_" + regionName_,
233  primaryMesh().time().timeName(),
234  primaryMesh(),
237  ),
238  regionMesh(),
240  ),
241  laplace2W0_
242  (
243  IOobject
244  (
245  "laplace2W0_" + regionName_,
246  primaryMesh().time().timeName(),
247  primaryMesh(),
250  ),
251  regionMesh(),
253  )
254 {
255  init(dict);
256 }
257 
258 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
259 
261 {}
262 
263 
265 {
266  nNonOrthCorr_ = solution().get<label>("nNonOrthCorr");
267  nSubCycles_ = solution().get<label>("nSubCycles");
268 
269  for (int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++)
270  {
272  }
273 }
274 
275 
277 {
278  const dimensionedScalar E("E", dimForce/dimArea , solid().E());
279  const dimensionedScalar nu("nu", dimless, solid().nu());
280 
281  return tmp<areaScalarField>(E*pow3(h_)/(12*(1 - sqr(nu))));
282 }
283 
284 
286 {
287  return tmp<areaScalarField>
288  (
289  new areaScalarField
290  (
291  IOobject
292  (
293  "rhos",
294  primaryMesh().time().timeName(),
295  primaryMesh(),
298  false
299  ),
300  regionMesh(),
301  dimensionedScalar("rho", dimDensity, solid().rho()),
302  zeroGradientFaPatchScalarField::typeName
303  )
304  );
305 }
306 
308 {}
309 
310 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
311 
312 } // End namespace regionModels
313 } // End namespace Foam
314 
315 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::regionModels::regionFaModel::solution
const dictionary & solution() const
Return the solution dictionary.
Definition: regionFaModelI.H:132
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::regionModels::KirchhoffShell::rho
const tmp< areaScalarField > rho() const
Return density [Kg/m3].
Definition: KirchhoffShell.C:285
Foam::dimPressure
const dimensionSet dimPressure
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:350
Foam::regionModels::KirchhoffShell::KirchhoffShell
KirchhoffShell(const word &modelType, const fvPatch &patch, const dictionary &dict)
Construct from components and dict.
Definition: KirchhoffShell.C:139
vibrationShellModel
Intermediate class for vibration-shell finite-area models.
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:194
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::faMatrix
A special matrix type and solver, designed for finite area solutions of scalar equations....
Definition: faMatricesFwd.H:43
Foam::fac::d2dt2
tmp< GeometricField< Type, faPatchField, areaMesh > > d2dt2(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facD2dt2.C:46
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::regionModels::vibrationShellModel::solid
const solidProperties & solid() const noexcept
Return solid properties.
Definition: vibrationShellModel.H:227
Foam::regionModels::defineTypeNameAndDebug
defineTypeNameAndDebug(KirchhoffShell, 0)
KirchhoffShell.H
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::regionModels::regionFaModel::primaryMesh
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionFaModelI.H:33
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::dimDensity
const dimensionSet dimDensity
Foam::fam::d2dt2
tmp< faMatrix< Type > > d2dt2(const GeometricField< Type, faPatchField, areaMesh > &vf)
Definition: famD2dt2.C:47
subCycle.H
Foam::regionModels::vibrationShellModel::w_
areaScalarField w_
Shell displacement.
Definition: vibrationShellModel.H:133
Foam::GeometricField::oldTime
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
Definition: GeometricField.C:850
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:107
Foam::dimForce
const dimensionSet dimForce
Foam::subCycleTime
A class for managing sub-cycling times.
Definition: subCycleTime.H:50
Foam::regionModels::KirchhoffShell::info
virtual void info()
Provide some feedback.
Definition: KirchhoffShell.C:307
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::faMatrix::solve
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
Definition: faMatrixSolve.C:55
Foam::fam::ddt
tmp< faMatrix< Type > > ddt(const GeometricField< Type, faPatchField, areaMesh > &vf)
Definition: famDdt.C:48
Foam::regionModels::KirchhoffShell::preEvolveRegion
virtual void preEvolveRegion()
Pre-evolve thermal baffle.
Definition: KirchhoffShell.C:260
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::regionModels::vibrationShellModel
Definition: vibrationShellModel.H:118
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::regionModels::KirchhoffShell::laplace2W0_
areaScalarField laplace2W0_
Cache laplace2.oldTime() in sub-cycling.
Definition: KirchhoffShell.H:167
Foam::regionModels::KirchhoffShell::D
const tmp< areaScalarField > D() const
Return stiffness.
Definition: KirchhoffShell.C:276
Foam::regionModels::KirchhoffShell::nSubCycles_
label nSubCycles_
Sub cycles.
Definition: KirchhoffShell.H:140
Foam::regionModels::KirchhoffShell::laplace2W_
areaScalarField laplace2W_
Laplace of the Laplace for the displacement.
Definition: KirchhoffShell.H:155
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:59
Foam::regionModels::vibrationShellModel::faOptions
Foam::fa::options & faOptions() noexcept
Return faOptions.
Definition: vibrationShellModel.H:221
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:89
Foam::inv
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:73
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::regionModels::KirchhoffShell::solveDisplacement
void solveDisplacement()
Solve energy equation.
Definition: KirchhoffShell.C:57
Foam::regionModels::vibrationShellModel::a_
areaScalarField a_
Shell acceleration.
Definition: vibrationShellModel.H:136
KirchhoffShell
Foam::regionModels::KirchhoffShell::w00_
areaScalarField w00_
Cache w.oldTime.oldTime() in sub-cycling.
Definition: KirchhoffShell.H:161
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
init
mesh init(true)
Foam::IOobject::READ_IF_PRESENT
Definition: IOobject.H:187
Foam::fa::optionList::constrain
void constrain(faMatrix< Type > &eqn)
Apply constraints to equation.
Definition: faOptionListTemplates.C:249
Foam::regionModels::KirchhoffShell::nNonOrthCorr_
label nNonOrthCorr_
Number of non orthogonal correctors.
Definition: KirchhoffShell.H:137
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::regionModels::KirchhoffShell::laplaceW0_
areaScalarField laplaceW0_
Cache laplaceW.oldTime() in sub-cycling.
Definition: KirchhoffShell.H:164
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
timeName
word timeName
Definition: getTimeIndex.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::regionModels::regionFaModel::regionMesh
const faMesh & regionMesh() const
Return the region mesh database.
Definition: regionFaModelI.H:63
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::dimensioned< scalar >
stdFoam::end
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::regionModels::regionFaModel::time
const Time & time() const
Return the reference to the time database.
Definition: regionFaModelI.H:39
Foam::regionModels::KirchhoffShell::laplaceW_
areaScalarField laplaceW_
Laplace of the displacement.
Definition: KirchhoffShell.H:152
Foam::regionModels::KirchhoffShell::w0_
areaScalarField w0_
Cache w.oldTime() in sub-cycling.
Definition: KirchhoffShell.H:158
zeroGradientFaPatchFields.H
Foam::regionModels::KirchhoffShell::ps_
areaScalarField ps_
External surface source [Pa].
Definition: KirchhoffShell.H:146
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
fvPatchFields.H
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::regionModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(vibrationShellModel, KirchhoffShell, dictionary)
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
Foam::regionModels::KirchhoffShell::evolveRegion
virtual void evolveRegion()
Evolve the thermal baffle.
Definition: KirchhoffShell.C:264
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:280
w0
#define w0
Definition: blockCreate.C:33
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::GeometricField< scalar, faPatchField, areaMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::regionModels::KirchhoffShell::h_
areaScalarField h_
Thickness [m].
Definition: KirchhoffShell.H:149
Foam::fa::optionList::correct
void correct(GeometricField< Type, faPatchField, areaMesh > &field)
Apply correction to field.
Definition: faOptionListTemplates.C:290
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189
Foam::IOobject::MUST_READ
Definition: IOobject.H:185