/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "KirchhoffShell.H"
#include "addToRunTimeSelectionTable.H"
#include "subCycle.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(KirchhoffShell, 0);
addToRunTimeSelectionTable(vibrationShellModel, KirchhoffShell, dictionary);
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool KirchhoffShell::init(const dictionary& dict)
{
this->solution().readEntry("nNonOrthCorr", nNonOrthCorr_);
return true;
}
void KirchhoffShell::solveDisplacement()
{
DebugInFunction << endl;
const Time& time = primaryMesh().time();
// Create operand fields for solid physics
const areaScalarField solidMass(rho()*h_);
const areaScalarField solidD(D()/solidMass);
// Deep copy old times of shell displacement field
auto tw0 = tmp::New(w_.oldTime());
auto tw00 = tmp::New(w_.oldTime().oldTime());
// Flag terms to avoid redundant time-derivative calculations
const bool f0_enabled = (f0_.value() != scalar(0));
const bool f1_enabled = (f1_.value() != scalar(0));
const bool f2_enabled = (f2_.value() != scalar(0));
// Restore various old fields in sub-cycling, if need be
if (nSubCycles_ > 1)
{
w_.oldTime() = w0_;
w_.oldTime().oldTime() = w00_;
if (f0_enabled) laplaceW_.oldTime() = laplaceW0_;
if (f2_enabled) laplace2W_.oldTime() = laplace2W0_;
}
for
(
subCycleTime wSubCycle
(
const_cast