Avoid race condition with single processor compilation of conjugateHeatFoam
[foam-extend-3.0.git] / applications / solvers / coupled / conjugateHeatTransfer / fvPatchFields / externalRadiation / ersPointSource / ersPointSource.C
blobf8b206c5732dc736a7eb4dbc3dd2fe15fad6103f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     |
5     \\  /    A nd           | For copyright notice see file Copyright
6      \\/     M anipulation  |
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 \*---------------------------------------------------------------------------*/
26 #include "ersPointSource.H"
27 #include "addToRunTimeSelectionTable.H"
29 namespace Foam
32 defineTypeNameAndDebug(ersPointSource, 0);
33 addToRunTimeSelectionTable(externalRadiationSource, ersPointSource, dictionary);
35 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
37 ersPointSource::ersPointSource
39     const word& name,
40     const dictionary& dict,
41     const fvPatch& p
44     ersConstantFlux(name),
45     qmax_(readScalar(dict.lookup("qmax"))),
46     alpha_(readScalar(dict.lookup("alpha"))),
47     direction_(dict.lookup("direction"))
49     q() = -alpha_*qmax_*min(direction_ & p.Sf()/p.magSf(), 0.0);
53 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
55 void ersPointSource::write(Ostream& os) const
57     ersConstantFlux::write(os);
58     os.writeKeyword("qmax") << qmax_ << token::END_STATEMENT << nl;
59     os.writeKeyword("alpha") << alpha_ << token::END_STATEMENT << nl;
60     os.writeKeyword("direction") << direction_ << token::END_STATEMENT << nl;
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 } // End namespace Foam
68 // ************************************************************************* //