-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSetFluidGasSolidViscosity.h
142 lines (117 loc) · 4.81 KB
/
SetFluidGasSolidViscosity.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// ---------------------------------------------------------------------
//
// Copyright (c) 2019 - 2022 by the IBAMR developers
// All rights reserved.
//
//
// IBAMR is free software and is distributed under the 3-clause BSD
// license. The full text of the license can be found in the file
// COPYRIGHT at the top level directory of IBAMR.
//
// ---------------------------------------------------------------------
/////////////////////// INCLUDE GUARD ////////////////////////////////////
#ifndef included_SetFluidGasSolidViscosity
#define included_SetFluidGasSolidViscosity
///////////////////////////// INCLUDES ///////////////////////////////////
#include <ibamr/AdvDiffHierarchyIntegrator.h>
#include <ibtk/ibtk_utilities.h>
#include <tbox/Pointer.h>
#include <Variable.h>
namespace IBTK
{
class HierarchyMathOps;
}
/*!
* Pre processing call back function to be hooked into IBAMR::VCINSStaggeredHierarchyIntegrator class.
*
* \param rho_idx a patch data index for the current density variable maintained by the integrator.
* \param ctx is the pointer to SetFluidGasSolidViscosity class object.
*
* \TODO: Let's move this out of the global namespace and use "snake case" for static function names.
*/
void callSetFluidGasSolidViscosityCallbackFunction(int mu_idx,
SAMRAI::tbox::Pointer<SAMRAI::hier::Variable<NDIM> > mu_var,
SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops,
const int cycle_num,
const double time,
const double current_time,
const double new_time,
void* ctx);
/*!
* \brief Class SetFluidGasSolidViscosity is a utility class which sets the fluid and
* solid Eulerian density based on the current level set information
*/
class SetFluidGasSolidViscosity
{
public:
/*!
* The only constructor of this class.
*/
SetFluidGasSolidViscosity(const std::string& object_name,
SAMRAI::tbox::Pointer<IBAMR::AdvDiffHierarchyIntegrator> adv_diff_solver,
SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > ls_solid_var,
SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > ls_gas_var,
const double mu_fluid,
const double mu_gas,
const double mu_solid,
const int ls_reinit_interval,
const double num_solid_interface_cells,
const double num_gas_interface_cells,
const bool set_mu_solid);
/*!
* Destructor for this class.
*/
~SetFluidGasSolidViscosity() = default;
/*!
* Set the density based on the current level set information
*/
void setViscosityPatchData(int mu_idx,
SAMRAI::tbox::Pointer<SAMRAI::hier::Variable<NDIM> > mu_var,
SAMRAI::tbox::Pointer<IBTK::HierarchyMathOps> hier_math_ops,
const int cycle_num,
const double time,
const double current_time,
const double new_time);
private:
/*!
* Default constructor is not implemented and should not be used.
*/
SetFluidGasSolidViscosity() = delete;
/*!
* Default assignment operator is not implemented and should not be used.
*/
SetFluidGasSolidViscosity& operator=(const SetFluidGasSolidViscosity& that) = delete;
/*!
* Default copy constructor is not implemented and should not be used.
*/
SetFluidGasSolidViscosity(const SetFluidGasSolidViscosity& from) = delete;
/*!
* Name of this object.
*/
std::string d_object_name;
/*!
* Pointer to advection-diffusion solver.
*/
SAMRAI::tbox::Pointer<IBAMR::AdvDiffHierarchyIntegrator> d_adv_diff_solver;
/*!
* Level set variables
*/
SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > d_ls_solid_var, d_ls_gas_var;
/*!
* Density of the fluid and solid.
*/
double d_mu_fluid, d_mu_gas, d_mu_solid;
/*!
* Level set reinitialization interval
*/
int d_ls_reinit_interval;
/*!
* Number of cells over which to transition between values
*/
double d_num_solid_interface_cells, d_num_gas_interface_cells;
/*!
* Whether or not to set viscosity in the solid region
*/
bool d_set_mu_solid;
}; // SetFluidGasSolidViscosity
#endif // #ifndef included_SetFluidGasSolidViscosity