sfr_7pin.oudf 1.7 KB
Newer Older
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
// This is almost a normal .oudf file - we just need to be sure that for the
// boundaries that will receive heat flux from MOOSE, to set it with
// bc->wrk[bc->idM] (we write into this array from MOOSE).

void velocityDirichletConditions(bcData * bc)
{
  switch (bc->id)
  {
    case 3:
      bc->u = 0.0; // x-velocity
      bc->v = 0.0; // y-velocity
      bc->w = Vz;  // z-velocity
      break;
    default:
       throw std::runtime_error("Invalid Dirichlet velocity BC sideset! You entered: " +
         std::to_string(bc->id) + "; valid options: 3.");
  }
}

void scalarDirichletConditions(bcData * bc)
{
  if (bc->scalarId == 0) // temperature
  {
    switch (bc->id)
    {
      case 3:
        bc->s = inlet_T;
        break;
      default:
         throw std::runtime_error("Invalid Dirichlet temperature BC sideset! You entered: " +
           std::to_string(bc->id) + "; valid options: 3.");
    }
  }
  else
  {
    throw std::runtime_error("Invalid scalar ID for BC application! You entered: " +
      std::to_string(bc->scalarId) + "; valid options: 0.");
  }
}

void scalarNeumannConditions(bcData * bc)
{
  if (bc->scalarId == 0) // temperature
  {
    switch (bc->id)
    {
      case 1: // boundary coupled to MOOSE
        bc->flux = bc->wrk[bc->idM];
        break;
      case 2: // boundary coupled to MOOSE
        bc->flux = bc->wrk[bc->idM];
        break;
      default:
        break;
         throw std::runtime_error("Invalid Neumann temperature BC sideset! You entered: " +
           std::to_string(bc->id) + "; valid options: 1, 2.");
    }
  }
  else
  {
    throw std::runtime_error("Invalid scalar ID for BC application! You entered: " +
      std::to_string(bc->scalarId) + "; valid options: 0.");
  }
}