icoUncoupledKinematicCloud.C 3.46 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5
    \\  /    A nd           | www.openfoam.com
OpenFOAM bot's avatar
OpenFOAM bot committed
6
7
     \\/     M anipulation  |
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8
    Copyright (C) 2016 OpenFOAM Foundation
9
    Copyright (C) 2018-2020 OpenCFD Ltd.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM 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 3 of the License, or
    (at your option) any later version.

    OpenFOAM 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 OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "icoUncoupledKinematicCloud.H"
#include "singlePhaseTransportModel.H"
31
#include "gravityMeshObject.H"
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "addToRunTimeSelectionTable.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

namespace Foam
{
namespace functionObjects
{
    defineTypeNameAndDebug(icoUncoupledKinematicCloud, 0);
    addToRunTimeSelectionTable
    (
        functionObject,
        icoUncoupledKinematicCloud,
        dictionary
    );
}
}


// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

Foam::functionObjects::icoUncoupledKinematicCloud::icoUncoupledKinematicCloud
(
    const word& name,
    const Time& runTime,
    const dictionary& dict
)
:
    fvMeshFunctionObject(name, runTime, dict),
61
    g_(meshObjects::gravity::New(time_)),
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    laminarTransport_
    (
        mesh_.lookupObject<singlePhaseTransportModel>("transportProperties")
    ),
    rhoValue_
    (
        "rho",
        dimDensity,
        laminarTransport_
    ),
    rho_
    (
        IOobject
        (
            "rho",
            time_.timeName(),
            mesh_
        ),
        mesh_,
        rhoValue_
    ),
    mu_("mu", rhoValue_*laminarTransport_.nu()),
    U_
    (
86
        mesh_.lookupObject<volVectorField>(dict.getOrDefault<word>("U", "U"))
87
88
89
    ),
    kinematicCloudName_
    (
90
        dict.getOrDefault<word>("kinematicCloud", "kinematicCloud")
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    ),
    kinematicCloud_
    (
        kinematicCloudName_,
        rho_,
        U_,
        mu_,
        g_
    )
{}


// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //

Foam::functionObjects::icoUncoupledKinematicCloud::~icoUncoupledKinematicCloud()
{}


// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

bool Foam::functionObjects::icoUncoupledKinematicCloud::read
(
    const dictionary& dict
)
{
116
    return fvMeshFunctionObject::read(dict);
117
118
119
}


120
bool Foam::functionObjects::icoUncoupledKinematicCloud::execute()
121
122
123
124
125
126
127
128
{
    mu_ = rhoValue_*laminarTransport_.nu();
    kinematicCloud_.evolve();

    return true;
}


129
bool Foam::functionObjects::icoUncoupledKinematicCloud::write()
130
131
132
133
134
135
{
    return true;
}


// ************************************************************************* //