laplaceFilter.C
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 #include "laplaceFilter.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "calculatedFvPatchFields.H"
00030 #include "fvm.H"
00031 #include "fvc.H"
00032
00033
00034
00035 namespace Foam
00036 {
00037 defineTypeNameAndDebug(laplaceFilter, 0);
00038 addToRunTimeSelectionTable(LESfilter, laplaceFilter, dictionary);
00039 }
00040
00041
00042
00043
00044 Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, scalar widthCoeff)
00045 :
00046 LESfilter(mesh),
00047 widthCoeff_(widthCoeff),
00048 coeff_
00049 (
00050 IOobject
00051 (
00052 "laplaceFilterCoeff",
00053 mesh.time().timeName(),
00054 mesh
00055 ),
00056 mesh,
00057 dimensionedScalar("zero", dimLength*dimLength, 0),
00058 calculatedFvPatchScalarField::typeName
00059 )
00060 {
00061 coeff_.internalField() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
00062 }
00063
00064
00065 Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, const dictionary& bd)
00066 :
00067 LESfilter(mesh),
00068 widthCoeff_(readScalar(bd.subDict(type() + "Coeffs").lookup("widthCoeff"))),
00069 coeff_
00070 (
00071 IOobject
00072 (
00073 "laplaceFilterCoeff",
00074 mesh.time().timeName(),
00075 mesh
00076 ),
00077 mesh,
00078 dimensionedScalar("zero", dimLength*dimLength, 0),
00079 calculatedFvPatchScalarField::typeName
00080 )
00081 {
00082 coeff_.internalField() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
00083 }
00084
00085
00086
00087
00088 void Foam::laplaceFilter::read(const dictionary& bd)
00089 {
00090 bd.subDict(type() + "Coeffs").lookup("widthCoeff") >> widthCoeff_;
00091 }
00092
00093
00094
00095
00096 Foam::tmp<Foam::volScalarField> Foam::laplaceFilter::operator()
00097 (
00098 const tmp<volScalarField>& unFilteredField
00099 ) const
00100 {
00101 tmp<volScalarField> filteredField =
00102 unFilteredField() + fvc::laplacian(coeff_, unFilteredField());
00103
00104 unFilteredField.clear();
00105
00106 return filteredField;
00107 }
00108
00109
00110 Foam::tmp<Foam::volVectorField> Foam::laplaceFilter::operator()
00111 (
00112 const tmp<volVectorField>& unFilteredField
00113 ) const
00114 {
00115 tmp<volVectorField> filteredField =
00116 unFilteredField() + fvc::laplacian(coeff_, unFilteredField());
00117
00118 unFilteredField.clear();
00119
00120 return filteredField;
00121 }
00122
00123
00124 Foam::tmp<Foam::volSymmTensorField> Foam::laplaceFilter::operator()
00125 (
00126 const tmp<volSymmTensorField>& unFilteredField
00127 ) const
00128 {
00129 tmp<volSymmTensorField> filteredField =
00130 unFilteredField() + fvc::laplacian(coeff_, unFilteredField());
00131
00132 unFilteredField.clear();
00133
00134 return filteredField;
00135 }
00136
00137
00138 Foam::tmp<Foam::volTensorField> Foam::laplaceFilter::operator()
00139 (
00140 const tmp<volTensorField>& unFilteredField
00141 ) const
00142 {
00143 tmp<volTensorField> filteredField =
00144 unFilteredField() + fvc::laplacian(coeff_, unFilteredField());
00145
00146 unFilteredField.clear();
00147
00148 return filteredField;
00149 }
00150
00151
00152
Copyright © 2000-2009 OpenCFD Ltd