|
|
|
simpleFilter.CGo 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) 1991-2009 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 \*---------------------------------------------------------------------------*/ 00026 00027 #include "simpleFilter.H" 00028 #include "addToRunTimeSelectionTable.H" 00029 #include "fvc.H" 00030 00031 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // 00032 00033 namespace Foam 00034 { 00035 defineTypeNameAndDebug(simpleFilter, 0); 00036 addToRunTimeSelectionTable(LESfilter, simpleFilter, dictionary); 00037 } 00038 00039 00040 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 00041 00042 Foam::simpleFilter::simpleFilter 00043 ( 00044 const fvMesh& mesh 00045 ) 00046 : 00047 LESfilter(mesh) 00048 {} 00049 00050 00051 Foam::simpleFilter::simpleFilter(const fvMesh& mesh, const dictionary&) 00052 : 00053 LESfilter(mesh) 00054 {} 00055 00056 00057 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 00058 00059 void Foam::simpleFilter::read(const dictionary&) 00060 {} 00061 00062 00063 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // 00064 00065 Foam::tmp<Foam::volScalarField> Foam::simpleFilter::operator() 00066 ( 00067 const tmp<volScalarField>& unFilteredField 00068 ) const 00069 { 00070 tmp<volScalarField> filteredField = fvc::surfaceSum 00071 ( 00072 mesh().magSf()*fvc::interpolate(unFilteredField) 00073 )/fvc::surfaceSum(mesh().magSf()); 00074 00075 unFilteredField.clear(); 00076 00077 return filteredField; 00078 } 00079 00080 00081 Foam::tmp<Foam::volVectorField> Foam::simpleFilter::operator() 00082 ( 00083 const tmp<volVectorField>& unFilteredField 00084 ) const 00085 { 00086 tmp<volVectorField> filteredField = fvc::surfaceSum 00087 ( 00088 mesh().magSf()*fvc::interpolate(unFilteredField) 00089 )/fvc::surfaceSum(mesh().magSf()); 00090 00091 unFilteredField.clear(); 00092 00093 return filteredField; 00094 } 00095 00096 00097 Foam::tmp<Foam::volSymmTensorField> Foam::simpleFilter::operator() 00098 ( 00099 const tmp<volSymmTensorField>& unFilteredField 00100 ) const 00101 { 00102 tmp<volSymmTensorField> filteredField = fvc::surfaceSum 00103 ( 00104 mesh().magSf()*fvc::interpolate(unFilteredField) 00105 )/fvc::surfaceSum(mesh().magSf()); 00106 00107 unFilteredField.clear(); 00108 00109 return filteredField; 00110 } 00111 00112 00113 Foam::tmp<Foam::volTensorField> Foam::simpleFilter::operator() 00114 ( 00115 const tmp<volTensorField>& unFilteredField 00116 ) const 00117 { 00118 tmp<volTensorField> filteredField = fvc::surfaceSum 00119 ( 00120 mesh().magSf()*fvc::interpolate(unFilteredField) 00121 )/fvc::surfaceSum(mesh().magSf()); 00122 00123 unFilteredField.clear(); 00124 00125 return filteredField; 00126 } 00127 00128 00129 // ************************************************************************* // |