zeroeqncmodel.hh 16.9 KB
Newer Older
Thomas Fetzer's avatar
Thomas Fetzer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
 *   See the file COPYING for full copying permissions.                      *
 *                                                                           *
 *   This program is free software: you can redistribute it and/or modify    *
 *   it under the terms of the GNU General Public License as published by    *
 *   the Free Software Foundation, either version 2 of the License, or       *
 *   (at your option) any later version.                                     *
 *                                                                           *
 *   This program is distributed in the hope that it will be useful,         *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
 *   GNU General Public License for more details.                            *
 *                                                                           *
 *   You should have received a copy of the GNU General Public License       *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 *****************************************************************************/
/*!
 * \file
 * \brief Base class for all models which use the compositional ZeroEq box model.
 */
#ifndef DUMUX_ZEROEQNC_MODEL_HH
#define DUMUX_ZEROEQNC_MODEL_HH

#include "zeroeqncindices.hh"
#include "zeroeqncproperties.hh"
#include <dumux/freeflow/stokesnc/stokesncmodel.hh>
#include <dumux/freeflow/zeroeq/zeroeqmodel.hh>

namespace Dumux
{
/*!
 * \ingroup BoxZeroEqncModel
Thomas Fetzer's avatar
[docu]    
Thomas Fetzer committed
35
 * \brief Adaption of the box scheme to the compositional ZeroEq model.
Thomas Fetzer's avatar
Thomas Fetzer committed
36
 *
Hao Wu's avatar
Hao Wu committed
37
38
39
40
 * This model implements an single-phase isothermal compositional free flow
 * solving the mass and the momentum balance. For the momentum balance
 * the Reynolds-averaged Navier-Stokes (RANS) equation with zero equation
 * (algebraic) turbulence model is used.
Thomas Fetzer's avatar
Thomas Fetzer committed
41
 *
Hao Wu's avatar
Hao Wu committed
42
 * Mass balance:
Thomas Fetzer's avatar
Thomas Fetzer committed
43
 * \f[
Hao Wu's avatar
Hao Wu committed
44
 *  \frac{\partial \varrho_\textrm{g}}{\partial t}
Thomas Fetzer's avatar
Thomas Fetzer committed
45
 *  + \text{div} \left( \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} \right)
Hao Wu's avatar
Hao Wu committed
46
 *  - q_\textrm{g} = 0
Thomas Fetzer's avatar
Thomas Fetzer committed
47
48
 * \f]
 *
Hao Wu's avatar
Hao Wu committed
49
 * Momentum Balance:
Thomas Fetzer's avatar
Thomas Fetzer committed
50
 * \f[
Hao Wu's avatar
Hao Wu committed
51
 *   \frac{\partial \left(\varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g}\right)}{\partial t}
Thomas Fetzer's avatar
Thomas Fetzer committed
52
 *   + \text{div} \left(
Hao Wu's avatar
Hao Wu committed
53
54
 *     \varrho_\textrm{g} {\boldsymbol{v}_\textrm{g} {\boldsymbol{v}}_\textrm{g}}
 *     - \left[ \mu_\textrm{g} + \mu_\textrm{g,t} \right]
Thomas Fetzer's avatar
Thomas Fetzer committed
55
56
 *       \left( \textbf{grad}\, \boldsymbol{v}_\textrm{g}
 *              + \textbf{grad}\, \boldsymbol{v}_\textrm{g}^T \right)
Hao Wu's avatar
Hao Wu committed
57
58
 *   \right)
 *   + \left(p_\textrm{g} {\bf {I}} \right)
Thomas Fetzer's avatar
Thomas Fetzer committed
59
 *   - \varrho_\textrm{g} {\bf g} = 0
Thomas Fetzer's avatar
Thomas Fetzer committed
60
61
 * \f]
 *
Hao Wu's avatar
Hao Wu committed
62
 * Component mass balance equations:
Thomas Fetzer's avatar
Thomas Fetzer committed
63
 * \f[
Hao Wu's avatar
Hao Wu committed
64
 *  \frac{\partial \left(\varrho_\textrm{g} X_\textrm{g}^\kappa\right)}{\partial t}
Thomas Fetzer's avatar
Thomas Fetzer committed
65
 *  + \text{div} \left( \varrho_\textrm{g} {\boldsymbol{v}}_\textrm{g} X_\textrm{g}^\kappa
Hao Wu's avatar
Hao Wu committed
66
 *  - \left[ D^\kappa_\textrm{g} + D^\kappa_\textrm{g,t} \right]
Thomas Fetzer's avatar
Thomas Fetzer committed
67
 *    \varrho_\textrm{g} \frac{M^\kappa}{M_\textrm{g}} \textbf{grad}\, x_\textrm{g}^\kappa \right)
Hao Wu's avatar
Hao Wu committed
68
 *  - q_\textrm{g}^\kappa = 0
Thomas Fetzer's avatar
Thomas Fetzer committed
69
 * \f]
Thomas Fetzer's avatar
Thomas Fetzer committed
70
71
 * Please note that, even though it is n-component model, the diffusive
 * fluxes are still calculated with binary diffusion.
Thomas Fetzer's avatar
Thomas Fetzer committed
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 *
 * This is discretized by a fully-coupled vertex-centered finite volume
 * (box) scheme in space and by the implicit Euler method in time.
 */
template<class TypeTag>
class ZeroEqncModel : public ZeroEqModel<TypeTag>
{
    typedef ZeroEqModel<TypeTag> ParentType;
    typedef typename GET_PROP_TYPE(TypeTag, Model) Implementation;
    typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
    typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
    typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;

    enum {
        dim = GridView::dimension,
        dimWorld = GridView::dimensionworld,
        intervals = GET_PROP_VALUE(TypeTag, NumberOfIntervals),
        walls = (GET_PROP_VALUE(TypeTag, BBoxMinIsWall) ? 1 : 0)
Thomas Fetzer's avatar
Thomas Fetzer committed
90
                + (GET_PROP_VALUE(TypeTag, BBoxMaxIsWall) ? 1 : 0)
Thomas Fetzer's avatar
Thomas Fetzer committed
91
    };
Thomas Fetzer's avatar
Thomas Fetzer committed
92
93
    enum { transportCompIdx = Indices::transportCompIdx,
           numComponents = Indices::numComponents };
Thomas Fetzer's avatar
Thomas Fetzer committed
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
    enum { phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx) };

    typedef typename GridView::template Codim<0>::Iterator ElementIterator;
    typedef typename GridView::IntersectionIterator IntersectionIterator;

    typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition;

    typedef typename GridView::template Codim<0>::Entity Element;
    typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
    typedef typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes) ElementBoundaryTypes;
    typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;

    typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
    typedef typename GET_PROP_TYPE(TypeTag, VolumeVariables) VolumeVariables;
    typedef typename GET_PROP_TYPE(TypeTag, FluxVariables) FluxVariables;
    typedef typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables) ElementVolumeVariables;


public:
    ZeroEqncModel()
        :   flowNormal_(GET_PARAM_FROM_GROUP(TypeTag, int, ZeroEq, FlowNormal))
        ,   wallNormal_(GET_PARAM_FROM_GROUP(TypeTag, int, ZeroEq, WallNormal))
    {
        eps_ = 1e-6;

        // check whether sand grain roughness may be used
        if (GET_PARAM_FROM_GROUP(TypeTag, Scalar, ZeroEq, BBoxMinSandGrainRoughness) > 0
            || GET_PARAM_FROM_GROUP(TypeTag, Scalar, ZeroEq, BBoxMaxSandGrainRoughness) > 0)
        {
            Dune::dwarn << "warning: surface roughness will not be used for eddy diffusivity models." << std::endl;
        }
    }

Hao Wu's avatar
Hao Wu committed
127
    //! \copydoc ImplicitModel::addOutputVtkFields
Thomas Fetzer's avatar
Thomas Fetzer committed
128
129
130
131
132
    template <class MultiWriter>
    void addOutputVtkFields(const SolutionVector &sol,
                            MultiWriter &writer)
    {
        typedef Dune::BlockVector<Dune::FieldVector<Scalar, 1> > ScalarField;
Thomas Fetzer's avatar
Thomas Fetzer committed
133
        typedef Dune::BlockVector<Dune::FieldVector<Scalar, dim> > VectorField;
Thomas Fetzer's avatar
Thomas Fetzer committed
134
135
136

        // create the required scalar fields
        unsigned numVertices = this->gridView_().size(dim);
Thomas Fetzer's avatar
Thomas Fetzer committed
137
        unsigned numElements = this->gridView_().size(0);
Thomas Fetzer's avatar
Thomas Fetzer committed
138
139
        ScalarField &pN = *writer.allocateManagedBuffer(numVertices);
        ScalarField &delP = *writer.allocateManagedBuffer(numVertices);
Thomas Fetzer's avatar
Thomas Fetzer committed
140
        ScalarField *moleFraction[numComponents];
Thomas Fetzer's avatar
Thomas Fetzer committed
141
142
143
144
145
146
        ScalarField *massFraction[numComponents];
        ScalarField &rho = *writer.allocateManagedBuffer(numVertices);
        VectorField &velocity = *writer.template allocateManagedBuffer<Scalar, dim> (numVertices);
        ScalarField &mu = *writer.allocateManagedBuffer(numVertices);
        ScalarField &D = *writer.allocateManagedBuffer(numVertices);
        ScalarField &mut = *writer.allocateManagedBuffer(numElements);
Thomas Fetzer's avatar
Thomas Fetzer committed
147
        ScalarField &nut = *writer.allocateManagedBuffer(numElements);
Thomas Fetzer's avatar
Thomas Fetzer committed
148
149
150
151
152
        ScalarField &lmix = *writer.allocateManagedBuffer(numElements);
        ScalarField &uPlus = *writer.allocateManagedBuffer(numElements);
        ScalarField &yPlus = *writer.allocateManagedBuffer(numElements);
        ScalarField &Dt = *writer.allocateManagedBuffer(numElements);
        ScalarField &rank = *writer.allocateManagedBuffer(numElements);
Thomas Fetzer's avatar
Thomas Fetzer committed
153
154
155
156
157
        for (int i = 0; i < numComponents; ++i)
            moleFraction[i] = writer.template allocateManagedBuffer<Scalar, 1>(numVertices);
        for (int i = 0; i < numComponents; ++i)
            massFraction[i] = writer.template allocateManagedBuffer<Scalar, 1>(numVertices);

Thomas Fetzer's avatar
Thomas Fetzer committed
158
159
160
161
        // write volume values to .vtu and .csv
        std::ofstream volVarsFile("volVarsData.csv", std::ios_base::out);
        asImp_().writeVolVarsHeader(volVarsFile);
        volVarsFile << std::endl;
Thomas Fetzer's avatar
Thomas Fetzer committed
162
163
164

        FVElementGeometry fvGeometry;
        ElementBoundaryTypes elemBcTypes;
Thomas Fetzer's avatar
Thomas Fetzer committed
165
        VolumeVariables volVars;
Thomas Fetzer's avatar
Thomas Fetzer committed
166

Hao Wu's avatar
Hao Wu committed
167
168
169
        ElementIterator eIt = this->gridView_().template begin<0>();
        ElementIterator eEndIt = this->gridView_().template end<0>();
        for (; eIt != eEndIt; ++eIt)
Thomas Fetzer's avatar
Thomas Fetzer committed
170
        {
Hao Wu's avatar
Hao Wu committed
171
            int idx = this->elementMapper().map(*eIt);
Thomas Fetzer's avatar
Thomas Fetzer committed
172
173
            rank[idx] = this->gridView_().comm().rank();

Hao Wu's avatar
Hao Wu committed
174
175
            fvGeometry.update(this->gridView_(), *eIt);
            elemBcTypes.update(this->problem_(), *eIt, fvGeometry);
Thomas Fetzer's avatar
Thomas Fetzer committed
176

Hao Wu's avatar
Hao Wu committed
177
            int numLocalVerts = eIt->template count<dim>();
Thomas Fetzer's avatar
Thomas Fetzer committed
178
179
            for (int i = 0; i < numLocalVerts; ++i)
            {
Hao Wu's avatar
Hao Wu committed
180
181
                int vIdxGlobal = this->vertexMapper().map(*eIt, i, dim);
                volVars.update(sol[vIdxGlobal],
Thomas Fetzer's avatar
Thomas Fetzer committed
182
                               this->problem_(),
Hao Wu's avatar
Hao Wu committed
183
                               *eIt,
Thomas Fetzer's avatar
Thomas Fetzer committed
184
185
186
187
                               fvGeometry,
                               i,
                               false);

Thomas Fetzer's avatar
Thomas Fetzer committed
188
189
                pN[vIdxGlobal] = volVars.pressure();
                delP[vIdxGlobal] = volVars.pressure() - 1e5;
Thomas Fetzer's avatar
Thomas Fetzer committed
190
191
192
193
194
195
196
                for (int compIdx = 0; compIdx < numComponents; ++compIdx)
                {
                    (*moleFraction[compIdx])[vIdxGlobal]= volVars.moleFraction(compIdx);
                    (*massFraction[compIdx])[vIdxGlobal]= volVars.massFraction(compIdx);
                    Valgrind::CheckDefined((*moleFraction[compIdx])[vIdxGlobal]);
                    Valgrind::CheckDefined((*massFraction[compIdx])[vIdxGlobal]);
                }
Thomas Fetzer's avatar
Thomas Fetzer committed
197
198
199
                rho[vIdxGlobal] = volVars.density();
                mu[vIdxGlobal] = volVars.dynamicViscosity();
                D[vIdxGlobal] = volVars.diffusionCoeff(transportCompIdx);
Hao Wu's avatar
Hao Wu committed
200
                velocity[vIdxGlobal] = volVars.velocity();
Thomas Fetzer's avatar
Thomas Fetzer committed
201
202
203

                asImp_().writeVolVarsData(volVarsFile, volVars);
                volVarsFile << std::endl;
Thomas Fetzer's avatar
Thomas Fetzer committed
204
205
206
207
            }
        }
        writer.attachVertexData(pN, "P");
        writer.attachVertexData(delP, "delP");
Thomas Fetzer's avatar
Thomas Fetzer committed
208
209
210
211
212
213
214
215
216
217
218
219

        for (int j = 0; j < numComponents; ++j)
        {
            std::ostringstream moleFrac, massFrac;
            moleFrac << "x_" << FluidSystem::phaseName(phaseIdx)
                     << "^" << FluidSystem::componentName(j);
            writer.attachVertexData(*moleFraction[j], moleFrac.str().c_str());

            massFrac << "X_" << FluidSystem::phaseName(phaseIdx)
                     << "^" << FluidSystem::componentName(j);
            writer.attachVertexData(*massFraction[j], massFrac.str().c_str());
        }
Thomas Fetzer's avatar
Thomas Fetzer committed
220
        volVarsFile.close();
Thomas Fetzer's avatar
Thomas Fetzer committed
221

Thomas Fetzer's avatar
Thomas Fetzer committed
222
223
        writer.attachVertexData(rho, "rho");
        writer.attachVertexData(mu, "mu");
Thomas Fetzer's avatar
Thomas Fetzer committed
224
        writer.attachVertexData(D, "D");
Thomas Fetzer's avatar
Thomas Fetzer committed
225
226
        writer.attachVertexData(velocity, "v", dim);

Thomas Fetzer's avatar
Thomas Fetzer committed
227
        // ensure that the actual values are given out
Thomas Fetzer's avatar
Thomas Fetzer committed
228
229
        asImp_().updateWallProperties();

Thomas Fetzer's avatar
Thomas Fetzer committed
230
231
232
233
234
        // write flux values to .vtu and .csv
        std::ofstream fluxFile("fluxVarsData.csv", std::ios_base::out);
        asImp_().writeFluxVarsHeader(fluxFile);
        fluxFile << std::endl;

Hao Wu's avatar
Hao Wu committed
235
236
237
        eIt = this->gridView_().template begin<0>();
        eEndIt = this->gridView_().template end<0>();
        for (; eIt != eEndIt; ++eIt)
Thomas Fetzer's avatar
Thomas Fetzer committed
238
        {
Hao Wu's avatar
Hao Wu committed
239
            fvGeometry.update(this->gridView_(), *eIt);
Thomas Fetzer's avatar
Thomas Fetzer committed
240
241
242

            ElementVolumeVariables elemVolVars;
            elemVolVars.update(this->problem_(),
Hao Wu's avatar
Hao Wu committed
243
                               *eIt,
Thomas Fetzer's avatar
Thomas Fetzer committed
244
245
246
                               fvGeometry,
                               false);

Thomas Fetzer's avatar
Thomas Fetzer committed
247
248
            unsigned int numFluxVars = 0;
            Scalar sumDynamicEddyViscosity = 0.0;
Thomas Fetzer's avatar
Thomas Fetzer committed
249
            Scalar sumKinematicEddyViscosity = 0.0;
Thomas Fetzer's avatar
Thomas Fetzer committed
250
251
252
253
            Scalar sumMixingLength = 0.0;
            Scalar sumUPlus = 0.0;
            Scalar sumYPlus = 0.0;
            Scalar sumEddyDiffusivity = 0.0;
Thomas Fetzer's avatar
Thomas Fetzer committed
254

Thomas Fetzer's avatar
Thomas Fetzer committed
255
256
257
            IntersectionIterator isIt = this->gridView_().ibegin(*eIt);
            IntersectionIterator isEndIt = this->gridView_().iend(*eIt);
            for (; isIt != isEndIt; ++isIt)
Thomas Fetzer's avatar
Thomas Fetzer committed
258
            {
Hao Wu's avatar
Hao Wu committed
259
                int fIdx = isIt->indexInInside();
Thomas Fetzer's avatar
Thomas Fetzer committed
260

Thomas Fetzer's avatar
Thomas Fetzer committed
261
262
                FluxVariables fluxVars(this->problem_(), *eIt, fvGeometry,
                                       fIdx, elemVolVars, false);
Thomas Fetzer's avatar
Thomas Fetzer committed
263

Thomas Fetzer's avatar
Thomas Fetzer committed
264
265
                asImp_().writeFluxVarsData(fluxFile, fluxVars);
                fluxFile << std::endl;
Thomas Fetzer's avatar
Thomas Fetzer committed
266

Thomas Fetzer's avatar
Thomas Fetzer committed
267
                sumDynamicEddyViscosity += fluxVars.dynamicEddyViscosity();
Thomas Fetzer's avatar
Thomas Fetzer committed
268
                sumKinematicEddyViscosity += fluxVars.kinematicEddyViscosity();
Thomas Fetzer's avatar
Thomas Fetzer committed
269
270
271
272
273
                sumMixingLength += fluxVars.mixingLength();
                sumUPlus += fluxVars.uPlus();
                sumYPlus += fluxVars.yPlusRough();
                sumEddyDiffusivity += fluxVars.eddyDiffusivity();
                numFluxVars += 1;
Thomas Fetzer's avatar
Thomas Fetzer committed
274
275
            }

Thomas Fetzer's avatar
Thomas Fetzer committed
276
277
            int eIdxGlobal = this->elementMapper().map(*eIt);
            mut[eIdxGlobal] = sumDynamicEddyViscosity / numFluxVars;
Thomas Fetzer's avatar
Thomas Fetzer committed
278
            nut[eIdxGlobal] = sumKinematicEddyViscosity / numFluxVars;
Thomas Fetzer's avatar
Thomas Fetzer committed
279
280
281
282
283
284
            lmix[eIdxGlobal] = sumMixingLength / numFluxVars;
            uPlus[eIdxGlobal] = sumUPlus / numFluxVars;
            yPlus[eIdxGlobal] = sumYPlus / numFluxVars;
            Dt[eIdxGlobal] = sumEddyDiffusivity / numFluxVars;
        }
        fluxFile.close();
Thomas Fetzer's avatar
Thomas Fetzer committed
285

Thomas Fetzer's avatar
Thomas Fetzer committed
286
        writer.attachCellData(mut, "mu_t");
Thomas Fetzer's avatar
Thomas Fetzer committed
287
        writer.attachCellData(nut, "nu_t");
Thomas Fetzer's avatar
Thomas Fetzer committed
288
289
290
291
        writer.attachCellData(lmix, "l_mix");
        writer.attachCellData(uPlus, "u^+");
        writer.attachCellData(yPlus, "y^+");
        writer.attachCellData(Dt, "D_t");
Thomas Fetzer's avatar
Thomas Fetzer committed
292
293
    }

Thomas Fetzer's avatar
Thomas Fetzer committed
294
295
    //! \copydoc ZeroEqModel::writeFluxVarsHeader
    void writeFluxVarsHeader(std::ofstream &stream)
Thomas Fetzer's avatar
Thomas Fetzer committed
296
    {
Thomas Fetzer's avatar
Thomas Fetzer committed
297
298
        ParentType::writeFluxVarsHeader(stream);
        stream << "," << "eddyDiffusivity";
Thomas Fetzer's avatar
Thomas Fetzer committed
299
300
    }

Thomas Fetzer's avatar
Thomas Fetzer committed
301
302
    //! \copydoc ZeroEqModel::writeFluxVarsData
    void writeFluxVarsData(std::ofstream &stream, const FluxVariables &fluxVars)
Thomas Fetzer's avatar
Thomas Fetzer committed
303
    {
Thomas Fetzer's avatar
Thomas Fetzer committed
304
305
        ParentType::writeFluxVarsData(stream, fluxVars);
        stream << "," << fluxVars.eddyDiffusivity();
Thomas Fetzer's avatar
Thomas Fetzer committed
306
307
    }

Thomas Fetzer's avatar
Thomas Fetzer committed
308
309
310
311
312
    /*!
     * \name Wall properties
     */
    // \{

Thomas Fetzer's avatar
Thomas Fetzer committed
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
    //! \copydoc ZeroEqModel::resetWallProperties
    void resetWallProperties()
    {
        ParentType::resetWallProperties();

        for (int wallIdx = 0; wallIdx < walls; ++wallIdx)
            for (int posIdx = 0; posIdx < intervals; ++posIdx)
            {
                this->wall[wallIdx].maxMassFraction[posIdx] = 0.0;
                this->wall[wallIdx].maxMoleFraction[posIdx] = 0.0;
            }
    }

    //! \copydoc ZeroEqModel::calculateMaxFluxVars
    void calculateMaxFluxVars(const FluxVariables &fluxVars, const GlobalPosition &globalPos)
    {
        ParentType::calculateMaxFluxVars(fluxVars, globalPos);

        int posIdx = this->getPosIdx(globalPos);
        int wallIdx = this->getWallIdx(globalPos, posIdx);
        // mass fraction
        if (this->wall[wallIdx].maxMassFraction[posIdx] < fluxVars.massFraction(transportCompIdx))
            for (int wallIdx = 0; wallIdx < walls; ++wallIdx)
                this->wall[wallIdx].maxMassFraction[posIdx] = fluxVars.massFraction(transportCompIdx);
        // mole fraction
        if (this->wall[wallIdx].maxMoleFraction[posIdx] < fluxVars.moleFraction(transportCompIdx))
            for (int wallIdx = 0; wallIdx < walls; ++wallIdx)
                this->wall[wallIdx].maxMoleFraction[posIdx] = fluxVars.moleFraction(transportCompIdx);
    }

    //! \copydoc ZeroEqModel::doInterpolationFluxValues
    const void doInterpolationFluxValues(const int wallIdx, const int posIdx, const int prevIdx, const int nextIdx)
    {
        ParentType::doInterpolationFluxValues(wallIdx, posIdx, prevIdx, nextIdx);

        this->wall[wallIdx].maxMassFraction[posIdx] = this->interpolation(posIdx, prevIdx, this->wall[wallIdx].maxMassFraction[prevIdx], nextIdx, this->wall[wallIdx].maxMassFraction[nextIdx]);
        this->wall[wallIdx].maxMoleFraction[posIdx] = this->interpolation(posIdx, prevIdx, this->wall[wallIdx].maxMoleFraction[prevIdx], nextIdx, this->wall[wallIdx].maxMoleFraction[nextIdx]);
    }

Thomas Fetzer's avatar
Thomas Fetzer committed
352
353
    // \} // wall properties

Thomas Fetzer's avatar
Thomas Fetzer committed
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
    /*!
     * \brief Returns the name of used the eddy diffusivity model.
     */
    const char *eddyDiffusivityModelName() const
    {
        switch (GET_PARAM_FROM_GROUP(TypeTag, int, ZeroEq, EddyDiffusivityModel))
        {
            case EddyDiffusivityIndices::noEddyDiffusivityModel: // 0
                return "noEddyDiffusivityModel";
                break;
            case EddyDiffusivityIndices::reynoldsAnalogy: // 1
                return "reynoldsAnalogy";
                break;
            case EddyDiffusivityIndices::modifiedVanDriest: // 2
                return "modifiedVanDriest";
                break;
            case EddyDiffusivityIndices::deissler: // 3
                return "deissler";
                break;
            case EddyDiffusivityIndices::meier: // 4
                return "meier";
                break;
            case EddyDiffusivityIndices::exponential: // 5
                return "exponential";
                break;
            default:
                DUNE_THROW(Dune::NotImplemented, "This eddy diffusivity model is not implemented.");
        }
    }

private:
    Scalar eps_;
    const int flowNormal_;
    const int wallNormal_;

    Implementation &asImp_()
    { return *static_cast<Implementation*>(this); }
    const Implementation &asImp_() const
    { return *static_cast<const Implementation*>(this); }
};

}

#include "zeroeqncpropertydefaults.hh"

#endif // DUMUX_ZEROEQNC_MODEL_HH