FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

calculateAutoCorrelationFunctions.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2008-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 if (mesh.time().timeIndex() % vacf.sampleSteps() == 0)
00027 {
00028     IDLList<molecule>::iterator mol(molecules.begin());
00029 
00030     Field<vector> uVals(molecules.size());
00031 
00032     label uV = 0;
00033 
00034     for
00035     (
00036         mol = molecules.begin();
00037         mol != molecules.end();
00038         ++mol, uV++
00039     )
00040     {
00041         uVals[uV] = mol().U();
00042     }
00043 
00044     vacf.calculateCorrelationFunction(uVals);
00045 }
00046 
00047 if (mesh.time().timeIndex() % pacf.sampleSteps() == 0)
00048 {
00049     IDLList<molecule>::iterator mol(molecules.begin());
00050 
00051     vector p = vector::zero;
00052 
00053     for
00054     (
00055         mol = molecules.begin();
00056         mol != molecules.end();
00057         ++mol
00058     )
00059     {
00060         p.x() +=
00061             mol().mass() * mol().U().y() * mol().U().z()
00062           + 0.5*mol().rf().yz();
00063 
00064         p.y() +=
00065             mol().mass() * mol().U().z() * mol().U().x()
00066           + 0.5*mol().rf().zx();
00067 
00068         p.z() +=
00069             mol().mass() * mol().U().x() * mol().U().y()
00070           + 0.5*mol().rf().xy();
00071     }
00072 
00073     pacf.calculateCorrelationFunction(p);
00074 }
00075 
00076 if (mesh.time().timeIndex() % hfacf.sampleSteps() == 0)
00077 {
00078 
00079     IDLList<molecule>::iterator mol(molecules.begin());
00080 
00081     vector s = vector::zero;
00082 
00083     for
00084     (
00085         mol = molecules.begin();
00086         mol != molecules.end();
00087         ++mol
00088     )
00089     {
00090         s +=
00091         (
00092             0.5*mol().mass()*magSqr(mol().U())
00093           + mol().potentialEnergy()
00094         )*mol().U()
00095       + 0.5*(mol().rf() & mol().U());
00096     }
00097 
00098     hfacf.calculateCorrelationFunction(s);
00099 }
00100 
00101 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines