Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 vector singleStepTotalLinearMomentum(vector::zero);
00035
00036 vector singleStepTotalAngularMomentum(vector::zero);
00037
00038 scalar singleStepMaxVelocityMag = 0.0;
00039
00040 scalar singleStepTotalMass = 0.0;
00041
00042 scalar singleStepTotalLinearKE = 0.0;
00043
00044 scalar singleStepTotalAngularKE = 0.0;
00045
00046 scalar singleStepTotalPE = 0.0;
00047
00048 scalar singleStepTotalrDotf = 0.0;
00049
00050
00051
00052 label singleStepNMols = molecules.size();
00053
00054 label singleStepDOFs = 0;
00055
00056 {
00057 IDLList<molecule>::iterator mol(molecules.begin());
00058
00059 for
00060 (
00061 mol = molecules.begin();
00062 mol != molecules.end();
00063 ++mol
00064 )
00065 {
00066 label molId = mol().id();
00067
00068 scalar molMass(molecules.constProps(molId).mass());
00069
00070 singleStepTotalMass += molMass;
00071
00072
00073 }
00074
00075
00076
00077
00078
00079
00080 for
00081 (
00082 mol = molecules.begin();
00083 mol != molecules.end();
00084 ++mol
00085 )
00086 {
00087 label molId = mol().id();
00088
00089 const molecule::constantProperties cP(molecules.constProps(molId));
00090
00091 scalar molMass(cP.mass());
00092
00093 const diagTensor& molMoI(cP.momentOfInertia());
00094
00095 const vector& molV(mol().v());
00096
00097 const vector& molOmega(inv(molMoI) & mol().pi());
00098
00099 vector molPiGlobal = mol().Q() & mol().pi();
00100
00101 singleStepTotalLinearMomentum += molV * molMass;
00102
00103 singleStepTotalAngularMomentum += molPiGlobal;
00104
00105
00106 if(mag(molV) > singleStepMaxVelocityMag)
00107 {
00108 singleStepMaxVelocityMag = mag(molV);
00109 }
00110
00111 singleStepTotalLinearKE += 0.5*molMass*magSqr(molV);
00112
00113 singleStepTotalAngularKE += 0.5*(molOmega & molMoI & molOmega);
00114
00115 singleStepTotalPE += mol().potentialEnergy();
00116
00117 singleStepTotalrDotf += tr(mol().rf());
00118
00119 singleStepDOFs += cP.degreesOfFreedom();
00120 }
00121 }
00122
00123 if (Pstream::parRun())
00124 {
00125 reduce(singleStepTotalLinearMomentum, sumOp<vector>());
00126
00127 reduce(singleStepTotalAngularMomentum, sumOp<vector>());
00128
00129 reduce(singleStepMaxVelocityMag, maxOp<scalar>());
00130
00131 reduce(singleStepTotalMass, sumOp<scalar>());
00132
00133 reduce(singleStepTotalLinearKE, sumOp<scalar>());
00134
00135 reduce(singleStepTotalAngularKE, sumOp<scalar>());
00136
00137 reduce(singleStepTotalPE, sumOp<scalar>());
00138
00139 reduce(singleStepTotalrDotf, sumOp<scalar>());
00140
00141 reduce(singleStepNMols, sumOp<label>());
00142
00143 reduce(singleStepDOFs, sumOp<label>());
00144 }
00145
00146 if (singleStepNMols)
00147 {
00148 Info<< "Number of molecules in system = "
00149 << singleStepNMols << nl
00150 << "Overall number density = "
00151 << singleStepNMols/meshVolume << nl
00152 << "Overall mass density = "
00153 << singleStepTotalMass/meshVolume << nl
00154 << "Average linear momentum per molecule = "
00155 << singleStepTotalLinearMomentum/singleStepNMols << ' '
00156 << mag(singleStepTotalLinearMomentum)/singleStepNMols << nl
00157 << "Average angular momentum per molecule = "
00158 << singleStepTotalAngularMomentum << ' '
00159 << mag(singleStepTotalAngularMomentum)/singleStepNMols << nl
00160 << "Maximum |velocity| = "
00161 << singleStepMaxVelocityMag << nl
00162 << "Average linear KE per molecule = "
00163 << singleStepTotalLinearKE/singleStepNMols << nl
00164 << "Average angular KE per molecule = "
00165 << singleStepTotalAngularKE/singleStepNMols << nl
00166 << "Average PE per molecule = "
00167 << singleStepTotalPE/singleStepNMols << nl
00168 << "Average TE per molecule = "
00169 <<
00170 (
00171 singleStepTotalLinearKE
00172 + singleStepTotalAngularKE
00173 + singleStepTotalPE
00174 )
00175 /singleStepNMols
00176 << endl;
00177
00178
00179
00180
00181
00182
00183
00184
00185 }
00186 else
00187 {
00188 Info<< "No molecules in system" << endl;
00189 }
00190
00191
00192