temperatureAndPressure.H
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) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Global
27 temperatureAndPressure.H
28
29Description
30 Accumulates values for temperature and pressure measurement, and
31 calculates and outputs the average values at output times.
32 Requires temperatureAndPressureVariables.H to be declared before the
33 timeloop.
35\*---------------------------------------------------------------------------*/
52
53if (runTime.writeTime())
54{
56 {
57 Info<< "calculating averages" << endl;
58
60 (
61 2.0/(physicoChemical::k.value()*accumulatedDOFs)
62 *
63 (
65 -
67 )
68 );
69
71 (
72 (
73 (accumulatedNMols/nAveragingSteps)
74 *physicoChemical::k.value()*averageTemperature
75 + accumulatedTotalrDotfSum/(6.0*nAveragingSteps)
76 )
77 /
79 );
80
81 Info<< "----------------------------------------" << nl
82 << "Averaged properties" << nl
83 << "Average |velocity| = "
85 << "Average temperature = " << averageTemperature << nl
86 << "Average pressure = " << averagePressure << nl
87 << "----------------------------------------" << endl;
88 }
89 else
90 {
91 Info<< "Not averaging temperature and pressure: "
92 << "no molecules in system" << endl;
93 }
94
96
98
100
102
103 accumulatedTotalPE = 0.0;
104
106
108
109 accumulatedDOFs = 0;
110}
111
112
113// ************************************************************************* //
engineTime & runTime
scalar singleStepTotalMass
scalar singleStepTotalPE
label singleStepDOFs
scalar singleStepTotalrDotf
scalar singleStepTotalLinearKE
vector singleStepTotalLinearMomentum(Zero)
label singleStepNMols
scalar singleStepTotalAngularKE
scalar averagePressure
scalar averageTemperature
accumulatedTotalMass
accumulatedTotalAngularKE
accumulatedTotalLinearMomentum
accumulatedTotalPE
accumulatedTotalrDotfSum
accumulatedTotalLinearKE