tabulatedAccelerationSource.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 | Copyright (C) 2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "fvMesh.H"
28 #include "fvMatrices.H"
29 #include "geometricOneField.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace fv
37 {
38  defineTypeNameAndDebug(tabulatedAccelerationSource, 0);
40  (
41  option,
42  tabulatedAccelerationSource,
43  dictionary
44  );
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const word& name,
54  const word& modelType,
55  const dictionary& dict,
56  const fvMesh& mesh
57 )
58 :
59  option(name, modelType, dict, mesh),
60  motion_(coeffs_, mesh.time()),
61  UName_(coeffs_.lookupOrDefault<word>("UName", "U")),
62  g0_("g0", dimAcceleration, vector::zero)
63 {
64  fieldNames_.setSize(1, UName_);
65  applied_.setSize(1, false);
66 
67  if (mesh.foundObject<uniformDimensionedVectorField>("g"))
68  {
69  g0_ = mesh.lookupObject<uniformDimensionedVectorField>("g");
70  }
71 }
72 
73 
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 
77 (
78  fvMatrix<vector>& eqn,
79  const label fieldi
80 )
81 {
82  addSup<geometricOneField>(geometricOneField(), eqn, fieldi);
83 }
84 
85 
87 (
88  const volScalarField& rho,
89  fvMatrix<vector>& eqn,
90  const label fieldi
91 )
92 {
93  addSup<volScalarField>(rho, eqn, fieldi);
94 }
95 
96 
98 {
99  if (option::read(dict))
100  {
101  return motion_.read(coeffs_);
102  }
103  else
104  {
105  return false;
106  }
107 }
108 
109 
110 // ************************************************************************* //
Foam::fv::tabulatedAccelerationSource::addSup
void addSup(const RhoFieldType &rho, fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
Definition: tabulatedAccelerationSourceTemplates.C:35
tabulatedAccelerationSource.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::geometricOneField
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Definition: geometricOneField.H:52
fvMatrices.H
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Foam::UniformDimensionedField< vector >
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::fv::option
Finite volume options abtract base class. Provides a base set of controls, e.g.
Definition: fvOption.H:65
Foam::fv::option::coeffs_
dictionary coeffs_
Dictionary containing source coefficients.
Definition: fvOption.H:84
Foam::tabulated6DoFAcceleration::read
virtual bool read(const dictionary &accelerationCoeffs)
Update properties from given dictionary.
Definition: tabulated6DoFAcceleration.C:100
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fv::option::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: fvOptionIO.C:53
rho
rho
Definition: pEqn.H:3
Foam::dimAcceleration
const dimensionSet dimAcceleration
fv
labelList fv(nPoints)
Foam::fv::defineTypeNameAndDebug
defineTypeNameAndDebug(option, 0)
Foam::fv::addToRunTimeSelectionTable
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
geometricOneField.H
Foam::fv::tabulatedAccelerationSource::tabulatedAccelerationSource
tabulatedAccelerationSource(const tabulatedAccelerationSource &)
Disallow default bitwise copy construct.
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::fv::tabulatedAccelerationSource::motion_
tabulated6DoFAcceleration motion_
Run-time selectable acceleration model.
Definition: tabulatedAccelerationSource.H:79
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::fv::tabulatedAccelerationSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: tabulatedAccelerationSource.C:97
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47