IBAMR  IBAMR version 0.19.
Public Member Functions | List of all members
IBAMR::CFINSForcing Class Reference

Class CFINSForcing provides an interface for specifying a viscoelastic stress to be added to the Navier-Stokes equations. The class uses the advection diffusion integrator to update the viscoelastic stress. More...

#include <ibamr/CFINSForcing.h>

Inheritance diagram for IBAMR::CFINSForcing:
Inheritance graph
[legend]

Public Member Functions

 CFINSForcing (const std::string &object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, SAMRAI::tbox::Pointer< IBTK::CartGridFunction > u_fcn, SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > grid_geometry, SAMRAI::tbox::Pointer< IBAMR::AdvDiffSemiImplicitHierarchyIntegrator > adv_diff_integrator, SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > > visit_data_writer)
 This constructor creates Variable and VariableContext objects for storing the viscoleastic stresses at the centers of the Cartesian grid. Sets up the advection diffusion solver to use the velocity function prescribed. The initial and boundary conditions should be specified on the quantity being solved for (e.g. Conformation tensor or square root or logarithm of the conformation tensor). More...
 
 CFINSForcing (const std::string &object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > app_initializer, const SAMRAI::tbox::Pointer< IBAMR::INSHierarchyIntegrator > fluid_solver, SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > grid_geometry, SAMRAI::tbox::Pointer< IBAMR::AdvDiffSemiImplicitHierarchyIntegrator > adv_diff_integrator, SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > > visit_data_writer)
 This constructor creates Variable and VariableContext objects for storing the viscoleastic stresses at the centers of the Cartesian grid. Sets up the advection diffusion solver to use the fluid velocity from the fluid solver. Note that this function must be registered with the fluid solver as a forcing function for the viscoelastic stress to effect the fluid velocity. The initial and boundary conditions should be specified on the quantity being solved for (e.g. Conformation tensor or square root or logarithm of the conformation tensor). More...
 
 ~CFINSForcing ()
 Deallocates draw data and deletes boundary conditions. More...
 
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > getVariable ()
 This function returns a pointer to the cell variable that stores the viscoelastic stress. More...
 
int getVariableIdx ()
 This function returns the patch data index used to store the viscoelastic stress. More...
 
void registerCFStrategy (SAMRAI::tbox::Pointer< CFStrategy > rhs)
 This function registers a strategy with the class. More...
 

Methods to set patch data.

SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > d_C_cc_var
 
SAMRAI::tbox::Pointer< SAMRAI::hier::VariableContextd_context
 
int d_C_scratch_idx = IBTK::invalid_index
 
SAMRAI::tbox::Pointer< IBTK::muParserCartGridFunctiond_init_conds
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > d_conform_var_draw
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > d_stress_var_draw
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::CellVariable< NDIM, double > > d_div_sig_var_draw
 
int d_conform_idx_draw = IBTK::invalid_index
 
int d_stress_idx_draw = IBTK::invalid_index
 
int d_div_sig_idx_draw = IBTK::invalid_index
 
bool d_conform_draw = true
 
bool d_stress_draw = true
 
bool d_div_sig_draw = false
 
std::string d_fluid_model = "OLDROYDB"
 
std::string d_interp_type = "LINEAR"
 
bool d_project_conform = true
 
TensorEvolutionType d_evolve_type = STANDARD
 
SAMRAI::tbox::Pointer< AdvDiffSemiImplicitHierarchyIntegratord_adv_diff_integrator
 
SAMRAI::tbox::Pointer< CFUpperConvectiveOperatord_convec_oper
 
std::vector< std::unique_ptr< SAMRAI::solv::RobinBcCoefStrategy< NDIM > > > d_conc_bc_coefs
 
std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > d_conc_bc_coefs_ptrs
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > d_hierarchy
 
double d_max_det = std::numeric_limits<double>::quiet_NaN()
 
double d_min_det = std::numeric_limits<double>::quiet_NaN()
 
bool d_log_det = false
 
bool d_log_div_sig = false
 
bool d_positive_def = true
 
bool d_error_on_spd = false
 
double d_min_norm = std::numeric_limits<double>::quiet_NaN()
 
double d_max_norm = std::numeric_limits<double>::quiet_NaN()
 
SAMRAI::tbox::Array< doubled_div_sig_rel_thresh
 
SAMRAI::tbox::Array< doubled_div_sig_abs_thresh
 
bool d_div_sig_rel_tag = false
 
bool d_div_sig_abs_tag = false
 
SAMRAI::tbox::Pointer< IBTK::CartGridFunctiond_u_fcn
 
SAMRAI::tbox::Pointer< SAMRAI::pdat::FaceVariable< NDIM, double > > d_u_var
 
SAMRAI::tbox::Pointer< CFStrategyd_cf_strategy
 
bool isTimeDependent () const override
 Indicates whether the concrete INSStaggeredStochasticForcing object is time-dependent. More...
 
void setDataOnPatchHierarchy (const int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, const double data_time, const bool initial_time=false, const int coarsest_ln=IBTK::invalid_level_number, const int finest_ln=IBTK::invalid_level_number) override
 Compute the divergence of the stress tensor. Also sets up requested visualizations. More...
 
void setDataOnPatch (const int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > > patch, const double data_time, const bool initial_time=false, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > patch_level=SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >(nullptr)) override
 Evaluate the divergence on the patch interior. More...
 
void setDataOnPatchLevel (const int data_idx, SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > > level, const double data_time, const bool initial_time) override
 Evaluate the divergence on the specified patch level. More...
 
void checkPositiveDefinite (const int data_idx, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, const double data_time, const bool initial_time)
 Check whether the provided patch index stores a positive definite tensor. More...
 
void applyGradientDetector (SAMRAI::tbox::Pointer< SAMRAI::hier::BasePatchHierarchy< NDIM > > hierarchy, int level_number, double error_data_time, int tag_index, bool initial_time, bool)
 Tag cells based on the specifications provided in the input database. More...
 
void projectTensor (const int data_idx, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, const double data_time, const bool initial_time, const bool extended_box)
 Projects the symmetric tensor stored in data_idx to the nearest non negative matrix in the L2 norm. More...
 
SAMRAI::tbox::Pointer< AdvDiffSemiImplicitHierarchyIntegratorgetAdvDiffHierarchyIntegrator ()
 Return the advection diffusion integrator used to evolve the conformation tensor. More...
 
static void apply_gradient_detector_callback (SAMRAI::tbox::Pointer< SAMRAI::hier::BasePatchHierarchy< NDIM > > hierarchy, int level_number, double error_data_time, int tag_index, bool initial_time, bool richardson_extrapolation_too, void *ctx)
 
static void apply_project_tensor_callback (double current_time, double new_time, int cycle_num, void *ctx)
 
void commonConstructor (const SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db, SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > > visit_data_writer, SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > > grid_geometry, std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * > vel_bcs)
 
void findDeterminant (const int data_idx, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, const double data_time, const bool initial_time)
 Compute the determinant of the symmetric tensor stored in data_idx. Fills in d_max_det and d_min_det. More...
 
void squareMatrix (const int data_idx, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, const SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, const double data_time, const bool initial_time, const int coarsest_ln, const int finest_ln, const bool extended_box)
 Square the symmetric tensor stored in data_idx in place. More...
 
void exponentiateMatrix (const int data_idx, const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > > var, const SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, const double data_time, const bool initial_time, const int coarsest_ln, const int finest_ln, const bool extended_box)
 Exponentiate the symmetric tensor stored in data_idx in place. More...
 
void setupPlotConformationTensor (int C_cc_idx)
 Given the conformation tensor, set up any requested drawing variables. More...
 

Detailed Description

Users must register a strategy operator CFStrategy that can compute (1) the relaxation of the stress and (2) the conversion from conformation tensor to stress tensor. One can choose from the pre-programmed models Oldroyd-B, Giesekus, or Rolie-Poly. Optionally, you can also register a your own strategy. The fluid model is specified through the database parameter "fluid_parameter". By specifying "USER_DEFINED", you can register your own strategy operator. This class currently solves for the conformation tensor or the square root or logarithm of the conformation tensor.

Input Database Parameters

There are also strategy specific items searched for in the database.

Constructor & Destructor Documentation

◆ CFINSForcing() [1/2]

IBAMR::CFINSForcing::CFINSForcing ( const std::string &  object_name,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database input_db,
SAMRAI::tbox::Pointer< IBTK::CartGridFunction u_fcn,
SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > >  grid_geometry,
SAMRAI::tbox::Pointer< IBAMR::AdvDiffSemiImplicitHierarchyIntegrator adv_diff_integrator,
SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > >  visit_data_writer 
)

◆ CFINSForcing() [2/2]

IBAMR::CFINSForcing::CFINSForcing ( const std::string &  object_name,
SAMRAI::tbox::Pointer< SAMRAI::tbox::Database app_initializer,
const SAMRAI::tbox::Pointer< IBAMR::INSHierarchyIntegrator fluid_solver,
SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > >  grid_geometry,
SAMRAI::tbox::Pointer< IBAMR::AdvDiffSemiImplicitHierarchyIntegrator adv_diff_integrator,
SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > >  visit_data_writer 
)

◆ ~CFINSForcing()

IBAMR::CFINSForcing::~CFINSForcing ( )

Member Function Documentation

◆ getVariable()

SAMRAI::tbox::Pointer<SAMRAI::hier::Variable<NDIM> > IBAMR::CFINSForcing::getVariable ( )
inline

◆ getVariableIdx()

int IBAMR::CFINSForcing::getVariableIdx ( )
inline

◆ registerCFStrategy()

void IBAMR::CFINSForcing::registerCFStrategy ( SAMRAI::tbox::Pointer< CFStrategy rhs)
Note
This function only should be called when fluid_model is set to USER_DEFINED in the input file.

◆ isTimeDependent()

bool IBAMR::CFINSForcing::isTimeDependent ( ) const
overridevirtual

◆ setDataOnPatchHierarchy()

void IBAMR::CFINSForcing::setDataOnPatchHierarchy ( const int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
const double  data_time,
const bool  initial_time = false,
const int  coarsest_ln = IBTK::invalid_level_number,
const int  finest_ln = IBTK::invalid_level_number 
)
overridevirtual

Reimplemented from IBTK::CartGridFunction.

◆ setDataOnPatch()

void IBAMR::CFINSForcing::setDataOnPatch ( const int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > >  patch,
const double  data_time,
const bool  initial_time = false,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  patch_level = SAMRAI::tbox::PointerSAMRAI::hier::PatchLevel< NDIM > >(nullptr) 
)
overridevirtual

◆ setDataOnPatchLevel()

void IBAMR::CFINSForcing::setDataOnPatchLevel ( const int  data_idx,
SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchLevel< NDIM > >  level,
const double  data_time,
const bool  initial_time 
)
overridevirtual

Reimplemented from IBTK::CartGridFunction.

◆ checkPositiveDefinite()

void IBAMR::CFINSForcing::checkPositiveDefinite ( const int  data_idx,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
const double  data_time,
const bool  initial_time 
)

◆ applyGradientDetector()

void IBAMR::CFINSForcing::applyGradientDetector ( SAMRAI::tbox::Pointer< SAMRAI::hier::BasePatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  error_data_time,
int  tag_index,
bool  initial_time,
bool   
)

◆ projectTensor()

void IBAMR::CFINSForcing::projectTensor ( const int  data_idx,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
const double  data_time,
const bool  initial_time,
const bool  extended_box 
)

◆ apply_gradient_detector_callback()

static void IBAMR::CFINSForcing::apply_gradient_detector_callback ( SAMRAI::tbox::Pointer< SAMRAI::hier::BasePatchHierarchy< NDIM > >  hierarchy,
int  level_number,
double  error_data_time,
int  tag_index,
bool  initial_time,
bool  richardson_extrapolation_too,
void *  ctx 
)
static

◆ apply_project_tensor_callback()

static void IBAMR::CFINSForcing::apply_project_tensor_callback ( double  current_time,
double  new_time,
int  cycle_num,
void *  ctx 
)
static

◆ getAdvDiffHierarchyIntegrator()

SAMRAI::tbox::Pointer<AdvDiffSemiImplicitHierarchyIntegrator> IBAMR::CFINSForcing::getAdvDiffHierarchyIntegrator ( )
inline

◆ commonConstructor()

void IBAMR::CFINSForcing::commonConstructor ( const SAMRAI::tbox::Pointer< SAMRAI::tbox::Database input_db,
SAMRAI::tbox::Pointer< SAMRAI::appu::VisItDataWriter< NDIM > >  visit_data_writer,
SAMRAI::tbox::Pointer< SAMRAI::geom::CartesianGridGeometry< NDIM > >  grid_geometry,
std::vector< SAMRAI::solv::RobinBcCoefStrategy< NDIM > * >  vel_bcs 
)
private

◆ findDeterminant()

void IBAMR::CFINSForcing::findDeterminant ( const int  data_idx,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
const double  data_time,
const bool  initial_time 
)
private

◆ squareMatrix()

void IBAMR::CFINSForcing::squareMatrix ( const int  data_idx,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
const SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
const double  data_time,
const bool  initial_time,
const int  coarsest_ln,
const int  finest_ln,
const bool  extended_box 
)
private

◆ exponentiateMatrix()

void IBAMR::CFINSForcing::exponentiateMatrix ( const int  data_idx,
const SAMRAI::tbox::Pointer< SAMRAI::hier::Variable< NDIM > >  var,
const SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  hierarchy,
const double  data_time,
const bool  initial_time,
const int  coarsest_ln,
const int  finest_ln,
const bool  extended_box 
)
private

◆ setupPlotConformationTensor()

void IBAMR::CFINSForcing::setupPlotConformationTensor ( int  C_cc_idx)
private

Member Data Documentation

◆ d_C_cc_var

SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > IBAMR::CFINSForcing::d_C_cc_var
private

◆ d_context

SAMRAI::tbox::Pointer<SAMRAI::hier::VariableContext> IBAMR::CFINSForcing::d_context
private

◆ d_C_scratch_idx

int IBAMR::CFINSForcing::d_C_scratch_idx = IBTK::invalid_index
private

◆ d_init_conds

SAMRAI::tbox::Pointer<IBTK::muParserCartGridFunction> IBAMR::CFINSForcing::d_init_conds
private

◆ d_conform_var_draw

SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > IBAMR::CFINSForcing::d_conform_var_draw
private

◆ d_stress_var_draw

SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > IBAMR::CFINSForcing::d_stress_var_draw
private

◆ d_div_sig_var_draw

SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM, double> > IBAMR::CFINSForcing::d_div_sig_var_draw
private

◆ d_conform_idx_draw

int IBAMR::CFINSForcing::d_conform_idx_draw = IBTK::invalid_index
private

◆ d_stress_idx_draw

int IBAMR::CFINSForcing::d_stress_idx_draw = IBTK::invalid_index
private

◆ d_div_sig_idx_draw

int IBAMR::CFINSForcing::d_div_sig_idx_draw = IBTK::invalid_index
private

◆ d_conform_draw

bool IBAMR::CFINSForcing::d_conform_draw = true
private

◆ d_stress_draw

bool IBAMR::CFINSForcing::d_stress_draw = true
private

◆ d_div_sig_draw

bool IBAMR::CFINSForcing::d_div_sig_draw = false
private

◆ d_fluid_model

std::string IBAMR::CFINSForcing::d_fluid_model = "OLDROYDB"
private

◆ d_interp_type

std::string IBAMR::CFINSForcing::d_interp_type = "LINEAR"
private

◆ d_project_conform

bool IBAMR::CFINSForcing::d_project_conform = true
private

◆ d_evolve_type

TensorEvolutionType IBAMR::CFINSForcing::d_evolve_type = STANDARD
private

◆ d_adv_diff_integrator

SAMRAI::tbox::Pointer<AdvDiffSemiImplicitHierarchyIntegrator> IBAMR::CFINSForcing::d_adv_diff_integrator
private

◆ d_convec_oper

SAMRAI::tbox::Pointer<CFUpperConvectiveOperator> IBAMR::CFINSForcing::d_convec_oper
private

◆ d_conc_bc_coefs

std::vector<std::unique_ptr<SAMRAI::solv::RobinBcCoefStrategy<NDIM> > > IBAMR::CFINSForcing::d_conc_bc_coefs
private

Boundary conditions.

◆ d_conc_bc_coefs_ptrs

std::vector<SAMRAI::solv::RobinBcCoefStrategy<NDIM>*> IBAMR::CFINSForcing::d_conc_bc_coefs_ptrs
private

Pointers to the previous objects (required by some APIs).

◆ d_hierarchy

SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > IBAMR::CFINSForcing::d_hierarchy
private

◆ d_max_det

double IBAMR::CFINSForcing::d_max_det = std::numeric_limits<double>::quiet_NaN()
private

◆ d_min_det

double IBAMR::CFINSForcing::d_min_det = std::numeric_limits<double>::quiet_NaN()
private

◆ d_log_det

bool IBAMR::CFINSForcing::d_log_det = false
private

◆ d_log_div_sig

bool IBAMR::CFINSForcing::d_log_div_sig = false
private

◆ d_positive_def

bool IBAMR::CFINSForcing::d_positive_def = true
private

◆ d_error_on_spd

bool IBAMR::CFINSForcing::d_error_on_spd = false
private

◆ d_min_norm

double IBAMR::CFINSForcing::d_min_norm = std::numeric_limits<double>::quiet_NaN()
private

◆ d_max_norm

double IBAMR::CFINSForcing::d_max_norm = std::numeric_limits<double>::quiet_NaN()
private

◆ d_div_sig_rel_thresh

SAMRAI::tbox::Array<double> IBAMR::CFINSForcing::d_div_sig_rel_thresh
private

◆ d_div_sig_abs_thresh

SAMRAI::tbox::Array<double> IBAMR::CFINSForcing::d_div_sig_abs_thresh
private

◆ d_div_sig_rel_tag

bool IBAMR::CFINSForcing::d_div_sig_rel_tag = false
private

◆ d_div_sig_abs_tag

bool IBAMR::CFINSForcing::d_div_sig_abs_tag = false
private

◆ d_u_fcn

SAMRAI::tbox::Pointer<IBTK::CartGridFunction> IBAMR::CFINSForcing::d_u_fcn
private

◆ d_u_var

SAMRAI::tbox::Pointer<SAMRAI::pdat::FaceVariable<NDIM, double> > IBAMR::CFINSForcing::d_u_var
private

◆ d_cf_strategy

SAMRAI::tbox::Pointer<CFStrategy> IBAMR::CFINSForcing::d_cf_strategy
private

◆ d_object_name

std::string IBTK::CartGridFunction::d_object_name
protectedinherited

The documentation for this class was generated from the following file: