ElmerFoamFSI  2.0
ElmerFoamFSI is fluid-solid interaction simulation application built up from OpenFOAM CFD and Elmer CSM coupled through the IMPACT multiphysics software integration infrastructure.
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
virtual int Run ( )
inlinevirtual

Reimplemented from couplingbase.

Definition at line 556 of file FsiCoupling.H.

References agentbase::FinalizeTimeStep(), fluidsAgent, agentbase::InitializeTimeStep(), openfoamagent::Run(), elmeragent::Run(), runMode, simulationFinalTime, simulationTime, simulationTimeStep, structuresAgent, TransferDisplacementsToFluid(), and TransferLoadsToStructures().

Referenced by SerialDriverProgram::DriverRun().

556  {
557  FunctionEntry("Run");
558  // Enter timestepping
559  int innerCount = 0;
560  int maxSubSteps = 1000;
561  int dumpinterval = 1;
562  int systemStep = 0;
563  std::stringstream outString;
564  outString << std::endl << std::endl
565  << "***************************************** " << std::endl;
566  outString << " Starting Stepping in Time " << std::endl;
567  outString << "***************************************** " << std::endl << std::endl;
568  outString << "ElmerFoamDriver:Run: Summary of the simulation " << std::endl;
569  outString << " Simulation Type = ElmerFoamFSI" << std::endl;
570  outString << " Simulation final time = " << simulationFinalTime << std::endl;
571  outString << " Simulation time step = " << simulationTimeStep << std::endl;
572  outString << std::endl;
573  StdOut(outString.str(),0,true);
574  outString.clear();
575  outString.str("");
577 
578  // if(!(time%screenInterval) && (innerCount == 0)){
579  // Write some stuff to screen
580  outString << "ElmerFoamDriver:Run: System timestep " << ++systemStep
581  << " @ Time = " << simulationTime << std::endl;
582  StdOut(outString.str(),1,true);
583  outString.clear();
584  outString.str("");
585 
586  // }
587 
588  if(!runMode){
589  // Transfer displacements @ Tn to fluids
590  outString << "ElmerFoamDriver:Run: Transferring displacements from structures to fluids @ time("
591  << simulationTime << ")" << std::endl;
592  StdOut(outString.str(),1,true);
593  outString.clear();
594  outString.str("");
596  }
597  if(runMode < 2){
599  // Step fluids to get loads @ T(n+1)
600  outString << "ElmerFoamDriver:Run: Stepping fluids to time("
601  << simulationTime+simulationTimeStep << ")" << std::endl;
602  StdOut(outString.str(),1,true);
603  outString.clear();
604  outString.str("");
606  }
607 
608  if(!runMode){
609  // Transfer loads @ T(n+1) to structures
610  //std::cout << "FSICoupling: Transferring loads from fluids to structures @ time("
611  // << simulationTime+simulationTimeStep << ")" << std::endl;
613  // Transfer pressures @ T(n+1) to structures
614  //std::cout << "FSICoupling: Transferring pressures from fluids to structures @ time("
615  // << simulationTime+simulationTimeStep << ")" << std::endl;
616  //TransferPressuresToStructures(fluidsAgent,structuresAgent);
617  //std::cout << "FSICoupling: Transferring pressures from fluids to structures with "
618  // << "TransferLoad function" << std::endl;
619  //int err = transferAgent->TransferLoad("pressure","Loads",true);
620  //if(err == -1){
621  // std::cout << "FSICoupling: Error: Unable to transfer pressures from fluids agent"
622  // << "to loads at structures agent." << std::endl;
623  // exit(1);
624  //}
625  }
626  if(!(runMode==1)){
628  // Step structures to get displacements @ T(n+1)
629  /* WK
630  outString << "ElmerFoamDriver:Run: Stepping structures to time("
631  << simulationTime+simulationTimeStep << ")" << std::endl; */
632  outString << "ElmerFoamDriver:Run: Stepping structures to time("
633  << simulationTime+simulationTimeStep << ")" << std::endl;
634  StdOut(outString.str(),1,true);
635  outString.clear();
636  outString.str("");
638  }
639 
640  // Finalize timestep and advance time T(n) --> T(n+1)
641  bool converged = true;
642  if(converged){
644  outString << "ElmerFoamDriver:Run: Converged at time("
645  << simulationTime << ")" << std::endl;
646  outString << "ElmerFoamDriver:Run: Converged at time("
647  << simulationTime << ")" << std::endl;
648  StdOut(outString.str(),1,true);
649  outString.clear();
650  outString.str("");
651  if(runMode < 2)
653  if(!(runMode == 1))
655  innerCount = 0;
656  } else {
657  innerCount++;
658  if(innerCount > maxSubSteps){
659  outString << "ElmerFoamDriver:Run: Failed to converge after "
660  << maxSubSteps << ", giving up." << std::endl;
661  StdOut(outString.str(),0,true);
662  outString.clear();
663  outString.str("");
664  return(1);
665  }
666  }
667 
668  StdOut(outString.str(),0,true);
669  outString.clear();
670  outString.str("");
671 
672  if(!(systemStep%dumpinterval)){
673  //DumpSolution();
674  }
675 
676  }
677  FunctionExit("Run");
678  return(0);
679  };
fluidagent * fluidsAgent
Definition: FsiCoupling.H:29
virtual int Run(double endTime)
Definition: OpenFoamAgent.H:65
int TransferDisplacementsToFluid(solidagent *solidAgent, fluidagent *fluidAgent)
Definition: FsiCoupling.H:59
virtual int FinalizeTimeStep(double time)
Definition: Orchestrator.H:25
solidagent * structuresAgent
Definition: FsiCoupling.H:30
double simulationTimeStep
Definition: FsiCoupling.H:41
virtual int InitializeTimeStep(double time)
Definition: Orchestrator.H:24
int TransferLoadsToStructures(fluidagent *fluidAgent, solidagent *solidAgent)
Definition: FsiCoupling.H:176
virtual int Run(double time)
Definition: ElmerAgent.H:71
double simulationTime
Definition: FsiCoupling.H:39
double simulationFinalTime
Definition: FsiCoupling.H:40

Here is the call graph for this function:

Here is the caller graph for this function: