initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / fvMotionSolver / motionDiffusivity / inverseVolume / inverseVolumeDiffusivity.C
blob82e96d0a57c17b608be1062eae0fb0c0127f0265
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "inverseVolumeDiffusivity.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "patchWave.H"
30 #include "labelHashSet.H"
31 #include "surfaceInterpolate.H"
32 #include "zeroGradientFvPatchFields.H"
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 namespace Foam
38     defineTypeNameAndDebug(inverseVolumeDiffusivity, 0);
40     addToRunTimeSelectionTable
41     (
42         motionDiffusivity,
43         inverseVolumeDiffusivity,
44         Istream
45     );
49 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
51 Foam::inverseVolumeDiffusivity::inverseVolumeDiffusivity
53     const fvMotionSolver& mSolver,
54     Istream& mdData
57     uniformDiffusivity(mSolver, mdData)
59     correct();
63 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
65 Foam::inverseVolumeDiffusivity::~inverseVolumeDiffusivity()
69 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
71 void Foam::inverseVolumeDiffusivity::correct()
73     const fvMesh& mesh = mSolver().mesh();
75     volScalarField V
76     (
77         IOobject
78         (
79             "V",
80             mesh.time().timeName(),
81             mesh
82         ),
83         mesh,
84         dimless,
85         zeroGradientFvPatchScalarField::typeName
86     );
88     V.internalField() = mesh.V();
89     V.correctBoundaryConditions();
91     faceDiffusivity_ = 1.0/fvc::interpolate(V);
95 // ************************************************************************* //