Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluidPropagateSurface Class Reference

#include <basic_actions.h>

Inheritance diagram for FluidPropagateSurface:
Collaboration diagram for FluidPropagateSurface:

Public Member Functions

 FluidPropagateSurface (FluidAgent *ag, BurnAgent *bag, const std::string b_rb, const std::string a_vm, double z)
 
void init (double t)
 
void run (double t, double dt, double alpha)
 
- Public Member Functions inherited from Action
 Action (void *p=0, char *name=NULL)
 
 Action (int n, const char *at[], int *i=NULL, void *p=0, char *name=NULL)
 
 Action (int n, const std::string at[], int *i=NULL, void *p=0, char *name=NULL)
 
virtual ~Action ()
 
virtual void declare (Scheduler &)
 
virtual void finalize ()
 
virtual char * name ()
 
void set_name (const char *name)
 
virtual void print (FILE *f)
 
virtual void print_toposort (FILE *f)
 
virtual void schedule ()
 

Private Attributes

FluidAgentfagent
 
BurnAgentbagent
 
double zoom
 
int p_rb_hdl
 
int b_rb_hdl
 
int fb_rb_hdl
 
int p_cnstr_type
 
int p_pmesh_hdl
 
int p_vm_hdl
 
int a_vm_hdl
 
int p_cflag_hdl
 
int p_pos_hdl
 
int p_bflag_hdl
 
int MAP_reduce_maxabs
 
int MAP_reduce_minabs
 
int PROP_set_cnstr
 
int PROP_propagate
 
int PROPCON_find_intersections
 
int PROPCON_constrain_displacements
 
int PROPCON_burnout
 
int PROPCON_burnout_filter
 

Additional Inherited Members

- Protected Types inherited from Action
enum  { IN =1, OUT =2, INOUT =3 }
 
- Protected Member Functions inherited from Action
int get_attribute_handle (int i)
 
int get_attribute_handle_const (int i)
 
int get_attribute_handle (const std::string str)
 
void set_attr (int n, const std::string at[], int *id=NULL)
 
void set_attr (int n, const char *at[], int *id=NULL)
 
void set_io (int n, const int *io)
 
void set_io (const char *io)
 
int get_io (int i)
 
- Protected Attributes inherited from Action
char * action_name
 
char ** attr
 
int * idx
 
int count
 
void * usr_ptr
 
std::vector< int > inout
 

Detailed Description

Definition at line 171 of file basic_actions.h.

Constructor & Destructor Documentation

FluidPropagateSurface ( FluidAgent ag,
BurnAgent bag,
const std::string  b_rb,
const std::string  a_vm,
double  z 
)

Definition at line 456 of file basic_actions.C.

References COM_DOUBLE, fagent, Action::IN, Action::OUT, FluidAgent::propBufAll, Agent::register_new_attribute(), Action::set_attr(), and Action::set_io().

459  :
460  Action(0, (const char**)NULL, NULL, NULL, (char *)"FluidPropagateSurface"), fagent(fag), bagent(bag), zoom(z)
461 {
462  int io[] = {IN, OUT};
463  set_io( 2, io);
464 
465  std::string atts[2];
466  atts[0] = b_rb;
467  atts[1] = a_vm;
468  set_attr(2, atts);
469 
470  fagent->register_new_attribute( fagent->propBufAll, ".vm", 'n', COM_DOUBLE, 3, "m/s");
471 }
std::string propBufAll
Definition: FluidAgent.h:77
void register_new_attribute(std::string target_window_, std::string attr_, char loc_, int type_, int ncomp_, const char *unit_)
Definition: Agent.C:322
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void set_io(int n, const int *io)
Definition: Action.h:70
Action(void *p=0, char *name=NULL)
Definition: Action.C:32
void set_attr(int n, const std::string at[], int *id=NULL)
Definition: Action.C:66

Here is the call graph for this function:

Member Function Documentation

void init ( double  t)
virtual

Reimplemented from Action.

Definition at line 473 of file basic_actions.C.

References a_vm_hdl, b_rb_hdl, COM_get_attribute_handle(), COM_get_function_handle(), COM_get_window_handle(), fagent, fb_rb_hdl, FluidAgent::fluidBufB, Action::get_attribute_handle(), Agent::get_communicator(), Agent::get_coupling(), Coupling::get_rocmancontrol_param(), load_rocmap(), load_rocon(), load_rocprop(), MAP_reduce_maxabs, MAP_reduce_minabs, p_bflag_hdl, p_cflag_hdl, p_cnstr_type, p_pmesh_hdl, p_pos_hdl, p_rb_hdl, p_vm_hdl, RocmanControl_parameters::PROP_fom, PROP_propagate, PROP_set_cnstr, FluidAgent::propBuf, FluidAgent::propBufAll, PROPCON_burnout, PROPCON_burnout_filter, PROPCON_constrain_displacements, and PROPCON_find_intersections.

473  {
476 
477  std::string propBuf = fagent->propBufAll;
478  int PROP_fom = fagent->get_coupling()->get_rocmancontrol_param()->PROP_fom;
479  if (!PROP_fom) propBuf = fagent->propBuf;
480  p_rb_hdl = COM_get_attribute_handle( propBuf+".rb");
481  p_pmesh_hdl = COM_get_attribute_handle( propBuf+".pmesh");
482  p_vm_hdl = COM_get_attribute_handle( propBuf+".vm");
483  p_bflag_hdl = COM_get_attribute_handle( propBuf+".bflag");
484  p_cnstr_type = COM_get_attribute_handle( propBuf+".cnstr_type");
485  p_cflag_hdl = COM_get_attribute_handle( propBuf+".cflag");
486  p_pos_hdl = COM_get_attribute_handle( propBuf+".positions");
488 
491  PROP_set_cnstr = COM_get_function_handle("PROP.set_constraints");
492  PROP_propagate = COM_get_function_handle("PROP.propagate");
493  if(COM_get_window_handle("PROPCON") >= 0) {
494  PROPCON_find_intersections = COM_get_function_handle("PROPCON.find_intersections");
495  PROPCON_constrain_displacements = COM_get_function_handle("PROPCON.constrain_displacements");
496  PROPCON_burnout = COM_get_function_handle("PROPCON.burnout");
497  PROPCON_burnout_filter = COM_get_function_handle("PROPCON.burnout_filter");
498  }
499  else {
502  PROPCON_burnout = -1;
503  }
504  load_rocmap();
505  MAP_reduce_maxabs = COM_get_function_handle("MAP.reduce_maxabs_on_shared_nodes");
506  MAP_reduce_minabs = COM_get_function_handle("MAP.reduce_minabs_on_shared_nodes");
507 }
std::string fluidBufB
Definition: FluidAgent.h:80
static void load_rocprop(const RocmanControl_parameters *param, MPI_Comm comm)
int get_attribute_handle(int i)
Definition: Action.C:93
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
std::string propBufAll
Definition: FluidAgent.h:77
std::string propBuf
Definition: FluidAgent.h:79
static void load_rocmap()
Coupling * get_coupling()
Definition: Agent.h:213
int COM_get_window_handle(const char *wname)
Definition: roccom_c++.h:404
const RocmanControl_parameters * get_rocmancontrol_param()
Definition: Coupling.h:184
MPI_Comm get_communicator() const
Definition: Agent.h:220
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428
static void load_rocon(const RocmanControl_parameters *param, MPI_Comm comm)

Here is the call graph for this function:

void run ( double  t,
double  dt,
double  alpha 
)
virtual

Reimplemented from Action.

Definition at line 509 of file basic_actions.C.

References a_vm_hdl, b_rb_hdl, COM_call_function(), RocBlas::copy, RocBlas::copy_scalar, RocBlas::div_scalar, fagent, fb_rb_hdl, Agent::get_communicator(), Agent::get_coupling(), Coupling::get_rocmancontrol_param(), MAN_DEBUG, man_verbose, MAP_reduce_maxabs, p_bflag_hdl, p_cflag_hdl, p_cnstr_type, p_pmesh_hdl, p_pos_hdl, p_rb_hdl, p_vm_hdl, RocmanControl_parameters::PROP_fom, PROP_propagate, PROP_set_cnstr, PROPCON_burnout, PROPCON_burnout_filter, PROPCON_constrain_displacements, PROPCON_find_intersections, rank, and zoom.

510 {
511  if (zoom <= 0.0 || fagent->get_coupling()->initial_start() ) return;
512 
513  int rank = 0;
514  MPI_Comm mycomm = fagent->get_communicator();
515  MPI_Comm_rank(mycomm,&rank);
516  if(rank == 0)
517  MAN_DEBUG(2, ("Rocstar: FluidPropagateSurface::run() with t:%e dt:%e zoom:%f p_cnstr_type:%d.\n", t, dt, zoom, p_cnstr_type));
518 
519  double zero = 0.0;
521 
523 
524  // Burnout strategy:
525  //
526  // integer array (bflag) lives on interacting boundary
527  // faces. bflag indicates whether the boundary face
528  // is burning/reacting/injecting, etc. In the current
529  // implementation, bflag can be 1 or 0 for burning or
530  // not-burning.
531  //
532  // integer array (cflag) lives on boundary nodes.
533  // cflag indicates the status of one or more geometrical
534  // or other imposed constraints on the deformation or
535  // solution space of the domain.
536  // In the current implementation cflag = 1 for nodes
537  // which have been constrained from further motion by
538  // the physical boundary. This happens when the domain
539  // boundary and the physical boundary come in contact.
540  //
541  // Based on the value of bflag, certain models may
542  // need to be used to determine physical quantities
543  // on the boundary. In the current implementation,
544  // the burnrate solver (Rocburn) can determine whether
545  // the propellant material should ignite, and if so
546  // it sets bflag to 1 and sets a burning rate
547  // for each burning face based on (aP^n), where
548  // [P = fluid pressure], and the temperature of the
549  // reacting surface.
550  //
551  //
552  // This function sets bflag to 0 for every burned out
553  // face. Burned out faces are determined by faces
554  // in which every node has cflag=1
555  // BurnOut(cflag,bflag);
556  if(PROPCON_burnout >= 0){
557  // std::cout << "Rocstar> Burning out surface elements with Rocon."
558  // << std::endl;
559  double data2 = 20000*dt;
561  MPI_Barrier(mycomm);
567  // COM_call_function( MAP_reduce_maxabs,
568  }
569 
570  //
571  // This function sets the burning rate (rb) to 0.
572  // The propagation code (Rocprop) sees rb as the
573  // (speed function). If the speed function is 0
574  // then Rocprop will not propagate the face. This will
575  // help Rocprop and Rocon to work together in keeping
576  // the propagation constrained to the constraint surface.
577  // p_rb_hdl = burning_rate
578  if(PROPCON_burnout_filter >= 0)
580  //
581 
582  // Now original code to propagate the mesh:
583  if ( p_cnstr_type > 0)
585 
586  double data = dt * zoom;
587 
588  MPI_Barrier(mycomm);
589  if(!rank && man_verbose > 2)
590  std::cout << "Rocstar: Calling Rocprop" << std::endl;
591  // p_rb_hdl is the "speed function"
593  MPI_Barrier(mycomm);
594  if(!rank && man_verbose > 2)
595  std::cout << "Rocstar: Rocprop done." << std::endl;
596  // Rocon determines if the domain boundary and the physical boundary have
597  // contacted and sets cflag (p_cflag_hdl) if so, and also constrains the
598  // nodes to not breach the physical boundary.
600  MPI_Barrier(mycomm);
601  if(!rank && man_verbose > 2)
602  std::cout << "Rocstar: Finding constraint intersections." << std::endl;
603  // std::cout << "Constraining displacements with Rocon" << std::endl;
604  // COM_call_function(PROPCON_find_intersections,&p_pmesh_hdl,&p_vm_hdl,&p_pos_hdl,&p_cflag_hdl);
605  MPI_Barrier(mycomm);
606  if(!rank && man_verbose > 2)
607  std::cout << "Rocstar: Reducing intersections." << std::endl;
608  // COM_call_function( MAP_reduce_maxabs, &p_cflag_hdl);
609  // COM_call_function( MAP_reduce_minabs, &p_cflag_hdl);
610  MPI_Barrier(mycomm);
611  if(!rank && man_verbose > 2)
612  std::cout << "Rocstar: Constraining displacements." << std::endl;
613  // COM_call_function(PROPCON_constrain_displacements,&p_pmesh_hdl,&p_vm_hdl,&p_pos_hdl,&p_cflag_hdl);
614  MPI_Barrier(mycomm);
615  if(!rank && man_verbose > 2)
616  std::cout << "Rocstar: Displacements constrained." << std::endl;
617  }
618 
620 
622 
623  // Let's try this to help fix Rocflo symmetry plane motion
625  // COM_call_function(MAP_reduce_minabs,&a_vm_hdl);
626 
627  if ( ! param->PROP_fom) {
628  // Move shared nodes between burning and nonburning panes.
630  }
631 
632  //
633  // Other functions that go elsewhere that are associated
634  // with burnout that I can think of are:
635  //
636  // Sets mass flux to 0.0 on burned out faces
637  // BurnOutFilter(bflag,0.0,mass_flux);
638  // or BurnOutFilter(bflag,mass_flux_insulation,mass_flux);
639  //
640  // Sets Tflame to Tgas for a perfect insulator, or
641  // something else if maybe the insulation chars or
642  // something.
643  // BurnOutFilter(bflag,gas_temp,tflame);
644  // or maybe BurOutFilter(bflag,ins_flame_temp,tflame);
645  //
646  //
647 
648 //debug_print(fagent->propBufAll+".vm", 102, 0);
649 }
static int copy
Definition: RocBlas.h:34
static int copy_scalar
Definition: RocBlas.h:43
int man_verbose
Coupling * get_coupling()
Definition: Agent.h:213
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
const RocmanControl_parameters * get_rocmancontrol_param()
Definition: Coupling.h:184
static int rank
Definition: advectest.C:66
MPI_Comm get_communicator() const
Definition: Agent.h:220
static int div_scalar
Definition: RocBlas.h:46

Here is the call graph for this function:

Member Data Documentation

int a_vm_hdl
private

Definition at line 180 of file basic_actions.h.

Referenced by init(), and run().

int b_rb_hdl
private

Definition at line 180 of file basic_actions.h.

Referenced by init(), and run().

BurnAgent* bagent
private

Definition at line 178 of file basic_actions.h.

FluidAgent* fagent
private

Definition at line 177 of file basic_actions.h.

Referenced by FluidPropagateSurface(), init(), and run().

int fb_rb_hdl
private

Definition at line 180 of file basic_actions.h.

Referenced by init(), and run().

int MAP_reduce_maxabs
private

Definition at line 182 of file basic_actions.h.

Referenced by init(), and run().

int MAP_reduce_minabs
private

Definition at line 183 of file basic_actions.h.

Referenced by init().

int p_bflag_hdl
private

Definition at line 181 of file basic_actions.h.

Referenced by init(), and run().

int p_cflag_hdl
private

Definition at line 181 of file basic_actions.h.

Referenced by init(), and run().

int p_cnstr_type
private

Definition at line 180 of file basic_actions.h.

Referenced by init(), and run().

int p_pmesh_hdl
private

Definition at line 180 of file basic_actions.h.

Referenced by init(), and run().

int p_pos_hdl
private

Definition at line 181 of file basic_actions.h.

Referenced by init(), and run().

int p_rb_hdl
private

Definition at line 180 of file basic_actions.h.

Referenced by init(), and run().

int p_vm_hdl
private

Definition at line 180 of file basic_actions.h.

Referenced by init(), and run().

int PROP_propagate
private

Definition at line 184 of file basic_actions.h.

Referenced by init(), and run().

int PROP_set_cnstr
private

Definition at line 184 of file basic_actions.h.

Referenced by init(), and run().

int PROPCON_burnout
private

Definition at line 186 of file basic_actions.h.

Referenced by init(), and run().

int PROPCON_burnout_filter
private

Definition at line 186 of file basic_actions.h.

Referenced by init(), and run().

int PROPCON_constrain_displacements
private

Definition at line 185 of file basic_actions.h.

Referenced by init(), and run().

int PROPCON_find_intersections
private

Definition at line 185 of file basic_actions.h.

Referenced by init(), and run().

double zoom
private

Definition at line 179 of file basic_actions.h.

Referenced by run().


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