Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
builtin_couplings.C
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // $Id: builtin_couplings.C,v 1.41 2010/02/18 21:47:40 juzhang Exp $
24 
29 /* Author: Gengbin Zheng */
30 
31 #include "rocman.h"
32 #include "builtin_couplings.h"
33 #include "FluidAgent.h"
34 #include "SolidAgent.h"
35 #include "BurnAgent.h"
36 #include "basic_actions.h"
37 #include "transfer_actions.h"
38 #include "Interpolate.h"
39 
40 /**************************************************************************
41  Fluid Alone no Burn
42 **************************************************************************/
43 
44 // fluid alone
45 static void declare_fluid_actions( FluidAgent *fluid_agent) {
46  const std::string ifluid_i = fluid_agent->ifluid_i;
47  const std::string fluidBufB = fluid_agent->fluidBufB;
48  const std::string fluidBufNB = fluid_agent->fluidBufNB;
49  const std::string fluidBufNG = fluid_agent->fluidBufNG;
50 
51  // No action for initial call back routine
52  fluid_agent->add_icaction( new DummyAction());
53 
54  // UPDATE_INBUFF_BC_FLUID
55  // Level-1 boundary condition: Set bflag and Tflm_alp to 0
56  fluid_agent->add_bcaction( new SetZero( fluidBufB+".Tflm_alp"), 1);
57  //fluid_agent->add_bcaction( new SetZero( fluidBufNB+".Tb_alp"), 1);
58  // fluid_agent->add_bcaction( new SetZero( fluidBufB+".bflag"), 1);
59 
60  // Level-2 boundary condition: Set mdot and rhofvf to 0
61  fluid_agent->add_bcaction( new SetZero( fluidBufB+".mdot_alp"), 2);
62  fluid_agent->add_bcaction( new SetZero( fluidBufNG+".rhofvf_alp"), 2);
63 
64  // Set displacement to zero.
65  //fluid_agent->add_gmaction( new SetZero( fluidBufNG+".du_alp"));
66  fluid_agent->add_gmaction( new Reset_du_alp( fluid_agent));
67 }
68 
69 FluidAlone::FluidAlone( const char *module, MPI_Comm com, Control_parameters *p, const RocmanControl_parameters *mp): Coupling("FluidAloneNoBurn", module, p, mp)
70 {
71 // p->zoomFactor = 1; // ignore zoom factor
72  maxPredCorr = 1;
73 
74  // Create agents
75  FluidAgent *fluid_agent = new FluidAgent( this, module, module, com);
76  add_agent( fluid_agent);
77 
78  // Create and register actions
79  scheduler.add_action( fluid_agent->get_main_action());
80 
81  // Declare the actions for fluid-agent
82  declare_fluid_actions( fluid_agent);
83 }
84 
85 /**************************************************************************
86  Solid Alone without Burn
87 **************************************************************************/
88 
89 // solid alone
90 static void declare_solid_actions( SolidAgent *solid_agent) {
91  std::string solidBuf = solid_agent->solidBuf;
92 
93  // No action for initial call back routine
94  solid_agent->add_icaction( new DummyAction());
95 
96  double pressure = solid_agent->get_coupling()->get_rocmancontrol_param()->pressure;
97 
98  // INIT_INBUFF_SOLID() in "solid_agent.f90"
99  solid_agent->add_bcinitaction( new SetValueDouble(solidBuf+".ts", pressure));
100 
101  // INIT_INTERP_HANDLES() in "solid_agent.f90"
102  solid_agent->add_bcaction( new Extrapolate_Linear(solid_agent, solid_agent,
103  solidBuf+".ts"));
104 }
105 
106 SolidAlone::SolidAlone( const char *module, MPI_Comm com, Control_parameters *p, const RocmanControl_parameters *mp): Coupling("SolidAlone", module, p, mp)
107 {
108  maxPredCorr = 1;
109 
110  // Create agents
111  SolidAgent *solid_agent = new SolidAgent( this, module, module, com);
112  add_agent( solid_agent);
113 
114  // Create and register actions
115  scheduler.add_action( solid_agent->get_main_action());
116 
117  // Declare the actions for solid-agent
118  declare_solid_actions( solid_agent);
119 }
120 
121 /**************************************************************************
122  Solid Fluid Coupling without Burn
123 **************************************************************************/
124 
125 SolidFluidSPC::SolidFluidSPC(
126  const char *fluidmodule, const char *solidmodule,
127  MPI_Comm com,
128  Control_parameters *p,
129  const RocmanControl_parameters *mp):
130  Coupling("FluidSolidSPC", fluidmodule, solidmodule, p, mp)
131 {
132  maxPredCorr = param->maxNumPredCorrCycles;
133 
134  // Create agents
135  SolidAgent *solid_agent = new SolidAgent(this, normalize_modname(solidmodule), solidmodule, com, 1);
136  add_agent( solid_agent);
137  const std::string solidBufBase = solid_agent->solidBufBase;
138  const std::string solidBuf = solid_agent->solidBuf;
139 
140  FluidAgent *fluid_agent = new FluidAgent(this, normalize_modname(fluidmodule), fluidmodule, com, 1);
141  add_agent( fluid_agent);
142  const std::string propBufAll = fluid_agent->propBufAll;
143  const std::string fluidBufNG = fluid_agent->fluidBufNG;
144 
145  double zoom = 1; // ignore zoom
146 
147  // ########### SOLID ############
148 
149  // INIT_INBUFF_SOLID()
150  solid_agent->add_bcinitaction( new LoadTransfer_FS(fluid_agent, solid_agent,
151  fluidBufNG+".ts", solidBuf+".ts", solidBuf+".pf"));
152 
153  // INIT_INTERP_HANDLES() in solid_agent.f90
154  solid_agent->add_bcaction( new Extrapolate_Linear(solid_agent, solid_agent,
155  solidBuf+".ts"), 1);
156 
157  // solid main physics routines
158  scheduler.add_action( solid_agent->get_main_action());
159 
160  // ########### FLUID ############
161 
162  // POST_UPDATE_SOLID
163  fluid_agent->add_bcinitaction( new GetDeformedMesh(fluid_agent, solid_agent,
164  solidBuf+".x", solidBuf+".uhat",
165  solidBuf+".nc"));
166 
167  // INIT_INBUFF_FLUID
168  fluid_agent->add_bcinitaction(new MeshMotionTransfer_SF(fluid_agent,
169  solid_agent,
170  solidBuf+".u", fluidBufNG+".total_disp",
171  fluidBufNG+".vm"));
172 
174  fluid_agent, solid_agent,
175  solidBuf+".vs", fluidBufNG+".vs"));
176 
177  // fluid main Physics routine
178  scheduler.add_action( fluid_agent->get_main_action());
179 
180  // fluid boundary conditions
181  fluid_agent->add_bcaction( new DummyAction(), 1);
182 
183  // INIT_INTERP_HANDLES() in "fluid_agent.f90"
184  fluid_agent->add_bcaction( new Interpolate_Linear(fluid_agent, fluid_agent,
185  fluidBufNG+".vs"), 2);
186 
187  // UPDATE_INBUFF_GM_FLUID()
188  fluid_agent->add_gmaction( new ComputeMeshMotion( fluid_agent,
189  propBufAll+".vm",
190  fluid_agent->get_surface_window()+".du_alp",
191  zoom));
192 }
193 
194 
195 
196 /**************************************************************************
197  Fluid alone with Burn
198 **************************************************************************/
199 
200 FluidBurnAlone::FluidBurnAlone( const char *fluidmodule, const char *burnmodule,
201  MPI_Comm com, Control_parameters *p,
202  const RocmanControl_parameters *mp):
203  Coupling("FluidBurnAlone", fluidmodule, burnmodule, p, mp)
204 {
205  maxPredCorr = 1;
206 
207  // Create agents
208  FluidAgent *fluid_agent = new FluidAgent( this, fluidmodule, fluidmodule, com);
209  add_agent( fluid_agent);
210  const std::string propBufAll = fluid_agent->propBufAll;
211  const std::string fluidBufB = fluid_agent->fluidBufB;
212  const std::string fluidBufNG = fluid_agent->fluidBufNG;
213 
214  BurnAgent *burn_agent = new BurnAgent( this, "Rocburn", burnmodule, com, fluidBufB);
215  add_agent( burn_agent);
216  const std::string iburn_ng = burn_agent->iburn_ng;
217 
218  const double rhoc = mp->rhoc;
219  double zoom = burn_agent->get_coupling()->get_control_param()->zoomFactor;
220 
221  // ########### INITIALIZATION ############
222 
223  // POST_INIT_FLUID
224  if (initial_start()) {
225  if (zoom > 0) {
226  std::string propBuf = fluid_agent->propBufAll;
227  int PROP_fom = mp->PROP_fom;
228  if (!PROP_fom) propBuf = fluid_agent->propBuf;
229  init_scheduler.add_action( new ComputePconn(fluid_agent,
230  propBufAll+".mesh",
231  propBufAll+".pconn",
232  propBuf+".pmesh"));
233  }
234  // INIT_INBUFF_FLUID
235  init_scheduler.add_action( new BCInitInvoker( fluid_agent));
236  init_scheduler.add_action( new Reset_du_alp( fluid_agent));
237  init_scheduler.add_action( new BCInvoker(fluid_agent, 1));
238  init_scheduler.add_action( new BCInvoker(fluid_agent, 2));
239  }
240 
241  // ########### BURN ############
242 
243 //RAF if (initial_start()) {
244  if (initial_start()) {
245  burn_agent->add_icaction( new BCInitInvoker(burn_agent));
246  // UPDATE_INBUFF_BC_BURN called in POST_INIT_BURN
247  burn_agent->add_icaction( new BCInvoker(burn_agent));
248  burn_agent->add_icaction( new ComputeFaceCenters(burn_agent,
249  iburn_ng+".nc",
250  iburn_ng+".centers",
251  iburn_ng+".normals"));
252  }
253 
254  // POST_INIT_BURN and INIT_BUFF_BURN
255  // INIT_INBUFF_BURN
256  burn_agent->add_bcinitaction( new CopyBurnFromParentMesh(burn_agent, fluid_agent));
257  burn_agent->add_bcinitaction( new SetValueDouble(iburn_ng+".rhos", rhoc));
258 
259  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
260  iburn_ng+".pf"));
261  burn_agent->add_bcaction( new Extrapolate_Central(burn_agent, fluid_agent,
262  iburn_ng+".qc", "_alp", 1));
263  burn_agent->add_bcaction( new Extrapolate_Central(burn_agent, fluid_agent,
264  iburn_ng+".qr", "_alp", 1));
265  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
266  iburn_ng+".Tf", "_alp", 1));
267  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
268  iburn_ng+".Tv", "_alp", 1));
269  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
270  iburn_ng+".dn", "_alp", 1));
271  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, burn_agent,
272  iburn_ng+".rhos", "_alp", 1));
273 
274  // burn main Physics routine
275  scheduler.add_action( burn_agent->get_main_action());
276 
277  // ########### FLUID ############
278 
279  // INIT_INBUFF_FLUID
280 // fluid_agent->add_bcinitaction( new DummyPrint(burn_agent, NULL, fluid_agent, "fluid"));
281  fluid_agent->add_bcinitaction( new SetZero( propBufAll+".vm"));
282  fluid_agent->add_bcinitaction( new FluidPropagateSurface( fluid_agent,
283  burn_agent,
284  iburn_ng+".rb", propBufAll+".vm", zoom));
285  fluid_agent->add_bcinitaction( new CopyBflagFromBurn( burn_agent));
286  fluid_agent->add_bcinitaction( new MassTransfer( fluid_agent, burn_agent,
287  iburn_ng+".rhos", iburn_ng+".rb",
288  fluidBufNG+".mdot"));
289 
290  // UPDATE_INBUFF_BC_FLUID
291  // Level-1 boundary condition:
292  fluid_agent->add_bcaction( new Interpolate_Linear( burn_agent, burn_agent,
293  iburn_ng+".Tflm"), 1);
294 
295  // Level-2 boundary condition
296  fluid_agent->add_bcaction( new Interpolate_Central( fluid_agent, fluid_agent,
297  fluidBufB+".mdot"), 2);
298  //fluid_agent->add_bcaction( new DummyPrint(burn_agent, NULL, fluid_agent, "MDOT"), 2);
299  fluid_agent->add_bcaction( new Interpolate_Central( burn_agent, burn_agent,
300  iburn_ng+".rb"), 2);
301  fluid_agent->add_bcaction( new ZoomInterface( fluid_agent, burn_agent,
302  fluidBufB+".mdot_alp", zoom), 2);
303  fluid_agent->add_bcaction( new SetZero( fluidBufNG+".rhofvf_alp"), 2);
304  fluid_agent->add_bcaction( new ComputeBurnPane( fluid_agent, burn_agent, NULL,
305  fluidBufB+".mdot_alp",
306  fluidBufB+".rhofvf_alp",
307  zoom), 2);
308 
309  // UPDATE_INBUFF_GM_FLUID()
310  fluid_agent->add_gmaction( new ComputeMeshMotion( fluid_agent,
311  propBufAll+".vm",
312  fluid_agent->get_surface_window()+".du_alp",
313  zoom));
314 
315  // Create and register actions
316  scheduler.add_action( fluid_agent->get_main_action());
317 
318 }
319 
320 /**************************************************************************
321  Solid with Burn
322 **************************************************************************/
323 
324 SolidBurn::SolidBurn( const char *solidmodule, const char *burnmodule,
325  MPI_Comm com,
327  Coupling("SolidBurn", solidmodule, burnmodule, p, mp)
328 {
329 #if 0
331 
332  // Create agents
333  SolidAgent *solid_agent = new SolidAgent( this, normalize_modname(solidmodule), solidmodule, com, 1);
334  add_agent( solid_agent);
335  const std::string solidBuf = solid_agent->solidBuf;
336  const std::string solid_propBufAll = solid_agent->propBufAll;
337  const std::string solid_propBuf = solid_agent->propBuf;
338 
339  BurnAgent *burn_agent = new BurnAgent( this, "Rocburn", burnmodule, com, fluidBufB);
340  add_agent( burn_agent);
341  const std::string iburn_ng = burn_agent->iburn_ng;
342 
343  double zoom = 1.0; // ignore zoom for coupled simulation
344  int PROP_fom = mp->PROP_fom;
345 
346  // ########### INITIALIZATION ############
347 
348  // POST_INIT_SOLID
349  init_scheduler.add_action( new GetDeformedMesh(fluid_agent, solid_agent,
350  solidBuf+".x", solidBuf+".uhat",
351  solidBuf+".nc"));
352  // withALE POST_INIT_SOLID
353  std::string propBuf = solid_agent->propBufAll;
354  if (!PROP_fom) propBuf = solid_agent->propBuf;
355  init_scheduler.add_action( new ComputePconn(solid_agent,
356  solid_agent->propBufAll+".mesh",
357  solid_agent->propBufAll+".pconn",
358  propBuf+".pmesh", &solid_agent->withALE));
359  if (initial_start())
360  init_scheduler.add_action( new BCInvoker(solid_agent, 1));
361 
362  //if (param->remeshed)
363  // init_scheduler.add_action( new SurfDiverAfterRemeshing( fluid_agent, solid_agent));
364 
365  // POST_INIT_FLUID
366  if (initial_start()) {
367  init_scheduler.add_action( new CopyValue(fluidBufNG+".nc", fluidBufNG+".nc_t0"));
368  // INIT_INBUFF_FLUID called in POST_INIT_FLUID
369  init_scheduler.add_action( new BCInitInvoker( fluid_agent));
370  // UPDATE_INBUFF_GM_FLUID
371  init_scheduler.add_action( new GMInvoker( fluid_agent));
372  // UPDATE_INBUFF_BC_FLUID called in POST_INIT_FLUID
373  init_scheduler.add_action( new BCInvoker(fluid_agent, 1));
374  init_scheduler.add_action( new BCInvoker(fluid_agent, 2));
375  }
376 
377  // POST_UPDATE_FLUID
378  init_scheduler.add_action( new BCInitInvoker( solid_agent));
379 /*
380  init_scheduler.add_action( new ComputeFluidLoad_ALE( fluid_agent, solid_agent,
381  fluidBufNG+".pf", fluidBufB+".mdot",
382  iburn_ng+".rb",
383  fluidBufNG+".ts"));
384 */
386  solid_agent, burn_agent,
387  fluidBufNG+".pf", fluidBufB+".mdot",
388  iburn_ng+".rb", solidBuf+".ts",
389  solidBuf+".pf"));
390 
391  // INIT_INBUFF_SOLID
392  init_scheduler.add_action( new BCInitInvoker( solid_agent));
393 
394  // POST_UPDATE_SOLID
396  fluid_agent, solid_agent,
397  solidBuf+".x", solidBuf+".uhat",
398  solidBuf+".nc", zoom));
399 
400  // ########### BURN ############
401 
402  // POST_INIT_BURN (IC)
403 //RAF if (initial_start()) {
404  if (1) {
405  burn_agent->add_icaction( new BCInitInvoker(burn_agent));
406  burn_agent->add_icaction( new BCInvoker(burn_agent));
407  burn_agent->add_icaction( new ComputeFaceCenters(burn_agent,
408  iburn_ng+".nc", iburn_ng+".centers"));
409  }
410 
411  burn_agent->add_bcinitaction( new CopyBurnFromParentMesh(burn_agent, fluid_agent));
412  burn_agent->add_bcinitaction( new TransferSolidDensity(fluid_agent,
413  solid_agent,
414  solidBuf+".rhos", fluidBufNG+".rhos"));
415 
416  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
417  iburn_ng+".pf"));
418  burn_agent->add_bcaction( new Extrapolate_Central(burn_agent, fluid_agent,
419  iburn_ng+".qc", "_alp", 1));
420  burn_agent->add_bcaction( new Extrapolate_Central(burn_agent, fluid_agent,
421  iburn_ng+".qr", "_alp", 1));
422  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
423  iburn_ng+".Tf", "_alp", 1));
424  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, burn_agent,
425  iburn_ng+".rhos", "_alp", 1));
426 
427  // burn main Physics routine
428  scheduler.add_action( burn_agent->get_main_action());
429 
430  // ########### SOLID ############
431 
432  // INIT_INBUFF_SOLID()
433 /*
434  solid_agent->add_bcinitaction( new LoadTransfer_FSc_ALE(fluid_agent,
435  solid_agent, burn_agent,
436  fluidBufNG+".pf", fluidBufB+".mdot",
437  iburn_ng+".rb", solidBuf+".ts",
438  solidBuf+".pf"));
439 */
440  solid_agent->add_bcinitaction( new TransferBurnRate_FS_ALE(
441  fluid_agent, solid_agent,
442  iburn_ng+".rb", solidBuf+".rb"));
443  solid_agent->add_bcinitaction( new SolidPropagateSurface_ALE( solid_agent,
444  solid_propBuf+".rb",
445  solid_propBufAll+".vbar", zoom));
446  solid_agent->add_bcinitaction( new CopyValue(solidBuf+".x", solidBuf+".nc",
447  &solid_agent->withALE));
448 
449  // INIT_INTERP_HANDLES() in "solid_agent.f90" // TODO: Change _alp as optional
450  solid_agent->add_bcaction( new Extrapolate_Linear(solid_agent, solid_agent,
451  solidBuf+".ts"), 1);
452  // for ALE
453  solid_agent->add_bcaction( new Extrapolate_Central(solid_agent, solid_agent,
454  solid_propBufAll+".vbar", "_alp", 1), 1);
455 
456  // solid main physics routines
457  scheduler.add_action( solid_agent->get_main_action());
458 
459 #endif
460 }
461 
462 /**************************************************************************
463  Fully coupled (Fluid/solid with Burn)
464 **************************************************************************/
465 
466 SolidFluidBurnSPC::SolidFluidBurnSPC(
467  const char *fluidmodule, const char *solidmodule,
468  const char *burnmodule, MPI_Comm com,
470  FullyCoupling("FluidSolidBurnSPC", fluidmodule, solidmodule, burnmodule, p, mp)
471 {
473 
474  // Create agents
475  fluid_agent = new FluidAgent( this, normalize_modname(fluidmodule), fluidmodule, com, 1);
476  add_agent( fluid_agent);
477  const std::string ifluid_all = fluid_agent->ifluid_all;
478  const std::string fluid_propBufAll = fluid_agent->propBufAll;
479  const std::string fluidBufB = fluid_agent->fluidBufB;
480  const std::string fluidBufNG = fluid_agent->fluidBufNG;
481 
482  solid_agent = new SolidAgent( this, normalize_modname(solidmodule), solidmodule, com, 1);
483  add_agent( solid_agent);
484  const std::string solidBuf = solid_agent->solidBuf;
485  const std::string solid_propBufAll = solid_agent->propBufAll;
486  const std::string solid_propBuf = solid_agent->propBuf;
487 
488  burn_agent = new BurnAgent( this, "Rocburn", burnmodule, com, fluidBufB);
489  add_agent( burn_agent);
490  const std::string iburn_ng = burn_agent->iburn_ng;
491 
492  double zoom = burn_agent->get_coupling()->get_control_param()->zoomFactor;
493  // double zoom = 1.0; // ignore zoom for coupled simulation
494  int PROP_fom = mp->PROP_fom;
495 
496  // ########### INITIALIZATION ############
497 
498  // POST_INIT_SOLID
499  init_scheduler.add_action( new GetDeformedMesh(fluid_agent, solid_agent,
500  solidBuf+".x", solidBuf+".uhat",
501  solidBuf+".nc"));
502  // withALE POST_INIT_SOLID
503  std::string propBuf = solid_agent->propBufAll;
504  if (!PROP_fom) propBuf = solid_agent->propBuf;
505  init_scheduler.add_action( new ComputePconn(solid_agent,
506  solid_agent->propBufAll+".mesh",
507  solid_agent->propBufAll+".pconn",
508  propBuf+".pmesh", &solid_agent->withALE));
509  if (initial_start() || mp->remeshed)
510  init_scheduler.add_action( new BCInvoker(solid_agent, 1));
511 
512  // POST_INIT_FLUID
513  if (initial_start() || mp->remeshed) {
514  if (!mp->remeshed)
515  init_scheduler.add_action( new CopyValue(fluidBufNG+".nc", fluidBufNG+".nc_t0"));
516  else // remeshed, restore nc_t0 from estimate
517  init_scheduler.add_action(new RemeshInit(fluid_agent,
518  solid_agent,
519  solidBuf+".u", fluidBufNG+".total_disp",
520  fluidBufNG+".nc", fluidBufNG+".nc_t0"));
521  // INIT_INBUFF_FLUID called in POST_INIT_FLUID
522  init_scheduler.add_action( new BCInitInvoker( fluid_agent));
523  // UPDATE_INBUFF_GM_FLUID
524  init_scheduler.add_action( new GMInvoker( fluid_agent));
525  // UPDATE_INBUFF_BC_FLUID called in POST_INIT_FLUID
526  init_scheduler.add_action( new BCInvoker(fluid_agent, 1));
527  init_scheduler.add_action( new BCInvoker(fluid_agent, 2));
528  }
529 
530  if (initial_start() || mp->remeshed) {
531  // POST_UPDATE_FLUID
533  fluid_agent, solid_agent,
534  fluidBufNG+".pf", fluidBufB+".mdot",
535  iburn_ng+".rb",
536  fluidBufNG+".ts"));
537  // INIT_INBUFF_SOLID
538 /*
539  init_scheduler.add_action( new LoadTransfer_FSc_ALE(fluid_agent,
540  solid_agent, burn_agent,
541  fluidBufNG+".pf", fluidBufB+".mdot",
542  iburn_ng+".rb", solidBuf+".ts",
543  solidBuf+".pf"));
544 */
545  init_scheduler.add_action( new BCInitInvoker( solid_agent));
546 
547  // POST_UPDATE_SOLID
549  fluid_agent, solid_agent,
550  solidBuf+".x", solidBuf+".uhat",
551  solidBuf+".nc", zoom));
552  }
553 
554  // ########### BURN ############
555 
556  // POST_INIT_BURN (IC)
557 //RAF if (initial_start() || mp->remeshed) {
558  if (1) {
559  burn_agent->add_icaction( new BCInitInvoker(burn_agent));
560  burn_agent->add_icaction( new BCInvoker(burn_agent));
561  burn_agent->add_icaction( new ComputeFaceCenters(burn_agent,
562  iburn_ng+".nc", iburn_ng+".centers"));
563  }
564 
565  burn_agent->add_bcinitaction( new CopyBurnFromParentMesh(burn_agent, fluid_agent));
566  burn_agent->add_bcinitaction( new TransferSolidDensity(fluid_agent,
567  solid_agent,
568  solidBuf+".rhos", fluidBufNG+".rhos"));
569 
570  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
571  iburn_ng+".pf"));
572  burn_agent->add_bcaction( new Extrapolate_Central(burn_agent, fluid_agent,
573  iburn_ng+".qc", "_alp", 1));
574  burn_agent->add_bcaction( new Extrapolate_Central(burn_agent, fluid_agent,
575  iburn_ng+".qr", "_alp", 1));
576  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, fluid_agent,
577  iburn_ng+".Tf", "_alp", 1));
578  burn_agent->add_bcaction( new Extrapolate_Linear(burn_agent, burn_agent,
579  iburn_ng+".rhos", "_alp", 1));
580 
581  // burn main Physics routine
582  scheduler.add_action( burn_agent->get_main_action());
583 
584  // ########### SOLID ############
585 
586  // INIT_INBUFF_SOLID()
587  solid_agent->add_bcinitaction( new LoadTransferOnly_FSc_ALE(fluid_agent,
588  solid_agent, burn_agent,
589  fluidBufNG+".ts",
590  solidBuf+".ts", solidBuf+".pf"));
591  solid_agent->add_bcinitaction( new TransferBurnRate_FS_ALE(
592  fluid_agent, solid_agent,
593  iburn_ng+".rb", solidBuf+".rb"));
594  solid_agent->add_bcinitaction( new SolidPropagateSurface_ALE( solid_agent,
595  solid_propBuf+".rb",
596  solid_propBufAll+".vbar", zoom));
597  solid_agent->add_bcinitaction( new CopyValue(solidBuf+".x", solidBuf+".nc",
598  &solid_agent->withALE));
599 
600  // INIT_INTERP_HANDLES() in "solid_agent.f90" // TODO: Change _alp as optional
601  solid_agent->add_bcaction( new Extrapolate_Linear(solid_agent, solid_agent,
602  solidBuf+".ts"), 1);
603  // for ALE
604  solid_agent->add_bcaction( new Extrapolate_Central(solid_agent, solid_agent,
605  solid_propBufAll+".vbar", "_alp", 1), 1);
606 
607  // solid main physics routines
608  scheduler.add_action( solid_agent->get_main_action());
609 
610  // ########### FLUID ############
611 
612  // POST_UPDATE_SOLID
613  fluid_agent->add_bcinitaction( new GetDeformedMesh_ALE(
614  fluid_agent, solid_agent,
615  solidBuf+".x", solidBuf+".uhat",
616  solidBuf+".nc", zoom));
617 
618  // INIT_INBUFF_FLUID
619  fluid_agent->add_bcinitaction( new SetZero( fluid_propBufAll+".vm"));
620  fluid_agent->add_bcinitaction(new MeshMotionTransfer_SF(fluid_agent,
621  solid_agent,
622  solidBuf+".u", fluidBufNG+".total_disp",
623  fluidBufNG+".vm"));
625  fluid_agent, solid_agent,
626  solidBuf+".vs", fluidBufNG+".vs"));
627  fluid_agent->add_bcinitaction( new MassTransfer_SF_ALE(fluid_agent,
628  solid_agent, burn_agent,
629  fluidBufNG+".mdot"));
630  fluid_agent->add_bcinitaction( new CopyBflagFromBurn(burn_agent));
631 
632  // UPDATE_INBUFF_BC_FLUID
633  // Level-1 boundary condition:
634  fluid_agent->add_bcaction( new Interpolate_Linear(burn_agent, burn_agent,
635  iburn_ng+".Tflm"), 1);
636 
637  // Level-2 boundary condition
638  fluid_agent->add_bcaction( new Interpolate_Central(fluid_agent, fluid_agent,
639  fluidBufB+".mdot"), 2);
640  fluid_agent->add_bcaction( new Interpolate_Central(burn_agent, burn_agent,
641  iburn_ng+".rb"), 2);
642  fluid_agent->add_bcaction( new ZoomInterface( fluid_agent, burn_agent,
643  fluidBufB+".mdot_alp", zoom), 2);
644  fluid_agent->add_bcaction( new Interpolate_Linear(fluid_agent, fluid_agent,
645  fluidBufNG+".vs"), 2);
646  fluid_agent->add_bcaction( new ComputeRhofvf( fluid_agent,
647  fluidBufNG+".vs_alp",
648  fluidBufNG+".rhof_alp",
649  fluidBufNG+".rhofvf_alp"), 2);
650  fluid_agent->add_bcaction( new ComputeBurnPane( fluid_agent, burn_agent,
651  solid_agent,
652  fluidBufB+".mdot_alp",
653  fluidBufB+".rhofvf_alp",
654  zoom), 2);
655 
656  // UPDATE_INBUFF_GM_FLUID()
657  fluid_agent->add_gmaction( new ComputeMeshMotion( fluid_agent,
658  fluid_propBufAll+".vm",
659  fluid_agent->get_surface_window()+".du_alp",
660  zoom));
661 
662  // fluid main Physics routine
663  scheduler.add_action( fluid_agent->get_main_action());
664 
665  // POST_UPDATE_FLUID
666  scheduler.add_action( new ComputeFluidLoad_ALE( fluid_agent, solid_agent,
667  fluidBufNG+".pf", fluidBufB+".mdot",
668  iburn_ng+".rb",
669  fluidBufNG+".ts"));
670 
671 /*
672  scheduler.add_action( new LoadTransfer_FSc_ALE(fluid_agent,
673  solid_agent, burn_agent,
674  fluidBufNG+".pf", fluidBufB+".mdot",
675  iburn_ng+".rb", solidBuf+".ts",
676  solidBuf+".pf"));
677 */
678 
679 // scheduler.add_action( new SurfDiver(fluid_agent, solid_agent));
680 }
681 
682 
683 
684 
685 
686 
687 
std::string ifluid_all
Definition: FluidAgent.h:69
std::string fluidBufB
Definition: FluidAgent.h:80
FluidAlone(const char *, MPI_Comm com, Control_parameters *p, const RocmanControl_parameters *mp)
int withALE
Definition: SolidAgent.h:84
virtual void add_action(Action *)
Definition: Scheduler.C:401
Agent * add_agent(Agent *)
Add new agent.
Definition: Coupling.C:174
int maxNumPredCorrCycles
Definition: Coupling.h:60
int maxPredCorr
Definition: Coupling.h:111
std::string propBufAll
Definition: FluidAgent.h:77
std::string propBuf
Definition: SolidAgent.h:70
void add_bcaction(Action *act, int l=1)
Definition: Agent.C:393
void add_bcinitaction(Action *act)
Definition: Agent.C:387
std::string iburn_ng
Definition: BurnAgent.h:55
static void declare_fluid_actions(FluidAgent *fluid_agent)
std::string get_surface_window() const
Definition: Agent.h:217
std::string normalize_modname(const char *mod)
Definition: Coupling.C:464
std::string ifluid_i
Definition: FluidAgent.h:70
std::string solidBufBase
Definition: SolidAgent.h:67
std::string propBuf
Definition: FluidAgent.h:79
Control_parameters * param
Definition: Coupling.h:113
void add_gmaction(Action *act)
Definition: Agent.C:411
Coupling * get_coupling()
Definition: Agent.h:213
std::string fluidBufNG
Definition: FluidAgent.h:78
std::string solidBuf
Definition: SolidAgent.h:68
double zoomFactor
Definition: Coupling.h:64
UserScheduler init_scheduler
Definition: Coupling.h:104
std::string propBufAll
Definition: SolidAgent.h:69
const RocmanControl_parameters * get_rocmancontrol_param()
Definition: Coupling.h:184
FluidBurnAlone(const char *, const char *, MPI_Comm com, Control_parameters *p, const RocmanControl_parameters *mp)
UserScheduler scheduler
Definition: Coupling.h:103
void add_icaction(Action *act)
Definition: Agent.C:381
Action * get_main_action()
Definition: Agent.h:183
const Control_parameters * get_control_param()
Definition: Coupling.h:183
static void declare_solid_actions(SolidAgent *solid_agent)
std::string fluidBufNB
Definition: FluidAgent.h:81
int initial_start() const
Definition: Coupling.h:163
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_GROUP_EMPTY INTEGER MPI_BAND INTEGER MPI_MINLOC INTEGER MPI_MAXLOC INTEGER MPI_OP_NULL INTEGER MPI_ERRORS_RETURN!INTEGER MPI_ORDER_FORTRAN INTEGER MPI_DISTRIBUTE_CYCLIC INTEGER MPI_DISTRIBUTE_DFLT_DARG INTEGER MPI_MAX_INFO_VAL INTEGER MPI_INFO_NULL!Optional Fortran Types Configure attempts to determine these!INTEGER MPI_INTEGER8 INTEGER MPI_INTEGER16 INTEGER MPI_REAL16 INTEGER MPI_COMPLEX32!This is now handled with either the pointer extension or this same appended at the end!COMMON MPIPRIV MPI_STATUSES_IGNORE!C!C Without this some Fortran implementations may make the common!C dynamic!C!C For a Fortran90 module