UEqnAddPorosity.H 1.82 KB
Newer Older
shunbo's avatar
shunbo 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Including porosity effects in UEqn following:
// Jensen, B., Jacobsen, N. G., & Christensen, E. D. (2014).
// Investigations on the porous media equations and resistance
// coefficients for coastal structures. Coastal Engineering, 84, 56-72.

if (porosityEnabled)
{
    const volScalarField& porosity = tporosity.cref();

    const word porosityModel("JensenEtAl2014");
    const dictionary& dict =
        porosityProperties.subDict(porosityModel + "Coeffs");
    const dimensionedScalar alpha(dimless/dimArea, dict.get<scalar>("alpha"));
    const dimensionedScalar beta(dimless/dimLength, dict.get<scalar>("beta"));
    const dimensionedScalar d50(dimless, dict.get<scalar>("d50"));
    const dimensionedScalar KC(dimless, dict.get<scalar>("KC"));

    // Generating Darcy-Forchheimer coefficient: F = rho*U*(a + b*|U|)
    // Shoud it be mu or muEff in the equation below?
    {
        // Darcy term
        volScalarField DarcyForchheimerCoeff
        (
            alpha*sqr(1 - porosity)*mixture.mu()/sqr(porosity)/sqr(d50)
        );

        // Adding Forchheimer term
        DarcyForchheimerCoeff += rho*mag(U)
            *beta*(1 + pos(KC)*7.5/KC)*(1 - porosity)/sqr(porosity)/d50;

        // Adding Darcy-Forchheimer term as implicit source term
        UEqn += fvm::Sp(DarcyForchheimerCoeff, U);
    }

    {
        // Generating added mass force coefficient
        const dimensionedScalar gamma_p(dimless, dict.get<scalar>("gamma_p"));
        const volScalarField Cm(gamma_p*(1 - porosity));

        UEqn += Cm*fvm::ddt(rho, U);
        UEqn += Cm*MRF.DDt(rho, U);
    }

    // Dividing both matrix entries and source term by porosity to compensate
    // for the fact that the FVM cell volume averages use division by cell
    // volume V whereas only the cell pore volume, porosity*V, is accessible.
    UEqn *= scalar(1)/porosity;
}