directionalPressureGradientExplicitSourceIO.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 OpenCFD Ltd.
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 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
31 (
32  Ostream& os
33 ) const
34 {
36 }
37 
38 
40 (
41  const dictionary& dict
42 )
43 {
44  const dictionary coeffs(dict.subDict(typeName + "Coeffs"));
45 
46  relaxationFactor_ =
47  coeffs.lookupOrDefault<scalar>("relaxationFactor", 0.3);
48 
49  coeffs.lookup("flowDir") >> flowDir_;
50  flowDir_ /= mag(flowDir_);
51 
52  if (model_ == pConstant)
53  {
54  coeffs.lookup("pressureDrop") >> pressureDrop_;
55  }
56  else if (model_ == pDarcyForchheimer)
57  {
58  coeffs.lookup("D") >> D_;
59  coeffs.lookup("I") >> I_;
60  coeffs.lookup("length") >> length_;
61  }
62 
63  return false;
64 }
65 
66 
67 // ************************************************************************* //
Foam::dictionary::lookup
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:449
Foam::dictionary::lookupOrDefault
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Definition: dictionaryTemplates.C:33
Foam::fv::directionalPressureGradientExplicitSource::writeData
virtual void writeData(Ostream &) const
Write the source properties.
Definition: directionalPressureGradientExplicitSourceIO.C:31
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
directionalPressureGradientExplicitSource.H
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
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::fv::directionalPressureGradientExplicitSource::read
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: directionalPressureGradientExplicitSourceIO.C:40