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 -------------------------------------------------------------------------------
10 License
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 
26 Global
27  temperatureAndPressure.H
28 
29 Description
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.
34 
35 \*---------------------------------------------------------------------------*/
36 
38 
40 
42 
44 
46 
48 
50 
52 
53 if (runTime.writeTime())
54 {
55  if (accumulatedNMols)
56  {
57  Info<< "calculating averages" << endl;
58 
60  (
62  *
63  (
65  -
67  )
68  );
69 
71  (
72  (
73  (accumulatedNMols/nAveragingSteps)
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 
107  accumulatedNMols = 0;
108 
109  accumulatedDOFs = 0;
110 }
111 
112 
113 // ************************************************************************* //
accumulatedTotalLinearKE
accumulatedTotalLinearKE
Definition: temperatureAndPressure.H:38
runTime
engineTime & runTime
Definition: createEngineTime.H:13
averagePressure
scalar averagePressure
Definition: temperatureAndPressureVariables.H:49
singleStepTotalLinearKE
scalar singleStepTotalLinearKE
Definition: meanMomentumEnergyAndNMols.H:42
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
accumulatedNMols
accumulatedNMols
Definition: temperatureAndPressure.H:46
singleStepTotalMass
scalar singleStepTotalMass
Definition: meanMomentumEnergyAndNMols.H:40
meshVolume
scalar meshVolume
Definition: temperatureAndPressureVariables.H:53
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
singleStepDOFs
label singleStepDOFs
Definition: meanMomentumEnergyAndNMols.H:54
accumulatedTotalAngularKE
accumulatedTotalAngularKE
Definition: temperatureAndPressure.H:40
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
singleStepTotalLinearMomentum
vector singleStepTotalLinearMomentum(Zero)
singleStepTotalAngularKE
scalar singleStepTotalAngularKE
Definition: meanMomentumEnergyAndNMols.H:44
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
singleStepTotalrDotf
scalar singleStepTotalrDotf
Definition: meanMomentumEnergyAndNMols.H:48
averageTemperature
scalar averageTemperature
Definition: temperatureAndPressureVariables.H:47
singleStepTotalPE
scalar singleStepTotalPE
Definition: meanMomentumEnergyAndNMols.H:46
accumulatedTotalMass
accumulatedTotalMass
Definition: temperatureAndPressure.H:36
singleStepNMols
label singleStepNMols
Definition: meanMomentumEnergyAndNMols.H:52
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
accumulatedTotalLinearMomentum
accumulatedTotalLinearMomentum
Definition: temperatureAndPressure.H:34
accumulatedDOFs
accumulatedDOFs
Definition: temperatureAndPressure.H:48
accumulatedTotalrDotfSum
accumulatedTotalrDotfSum
Definition: temperatureAndPressure.H:44
accumulatedTotalPE
accumulatedTotalPE
Definition: temperatureAndPressure.H:42