00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-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 #include "simpleFilter.H" 00027 #include <OpenFOAM/addToRunTimeSelectionTable.H> 00028 #include <finiteVolume/fvc.H> 00029 00030 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 00031 00032 namespace Foam 00033 { 00034 defineTypeNameAndDebug(simpleFilter, 0); 00035 addToRunTimeSelectionTable(LESfilter, simpleFilter, dictionary); 00036 } 00037 00038 00039 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 00040 00041 Foam::simpleFilter::simpleFilter 00042 ( 00043 const fvMesh& mesh 00044 ) 00045 : 00046 LESfilter(mesh) 00047 {} 00048 00049 00050 Foam::simpleFilter::simpleFilter(const fvMesh& mesh, const dictionary&) 00051 : 00052 LESfilter(mesh) 00053 {} 00054 00055 00056 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 00057 00058 void Foam::simpleFilter::read(const dictionary&) 00059 {} 00060 00061 00062 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // 00063 00064 Foam::tmp<Foam::volScalarField> Foam::simpleFilter::operator() 00065 ( 00066 const tmp<volScalarField>& unFilteredField 00067 ) const 00068 { 00069 tmp<volScalarField> filteredField = fvc::surfaceSum 00070 ( 00071 mesh().magSf()*fvc::interpolate(unFilteredField) 00072 )/fvc::surfaceSum(mesh().magSf()); 00073 00074 unFilteredField.clear(); 00075 00076 return filteredField; 00077 } 00078 00079 00080 Foam::tmp<Foam::volVectorField> Foam::simpleFilter::operator() 00081 ( 00082 const tmp<volVectorField>& unFilteredField 00083 ) const 00084 { 00085 tmp<volVectorField> filteredField = fvc::surfaceSum 00086 ( 00087 mesh().magSf()*fvc::interpolate(unFilteredField) 00088 )/fvc::surfaceSum(mesh().magSf()); 00089 00090 unFilteredField.clear(); 00091 00092 return filteredField; 00093 } 00094 00095 00096 Foam::tmp<Foam::volSymmTensorField> Foam::simpleFilter::operator() 00097 ( 00098 const tmp<volSymmTensorField>& unFilteredField 00099 ) const 00100 { 00101 tmp<volSymmTensorField> filteredField = fvc::surfaceSum 00102 ( 00103 mesh().magSf()*fvc::interpolate(unFilteredField) 00104 )/fvc::surfaceSum(mesh().magSf()); 00105 00106 unFilteredField.clear(); 00107 00108 return filteredField; 00109 } 00110 00111 00112 Foam::tmp<Foam::volTensorField> Foam::simpleFilter::operator() 00113 ( 00114 const tmp<volTensorField>& unFilteredField 00115 ) const 00116 { 00117 tmp<volTensorField> filteredField = fvc::surfaceSum 00118 ( 00119 mesh().magSf()*fvc::interpolate(unFilteredField) 00120 )/fvc::surfaceSum(mesh().magSf()); 00121 00122 unFilteredField.clear(); 00123 00124 return filteredField; 00125 } 00126 00127 00128 // ************************ vim: set sw=4 sts=4 et: ************************ //