@@ -1478,13 +1478,46 @@ void ScaTra::ScaTraTimIntImpl::set_convective_velocity(
14781478 discret_->set_state (nds_vel (), " convective velocity field" , convective_velocity);
14791479}
14801480
1481+ /* ----------------------------------------------------------------------*
1482+ *----------------------------------------------------------------------*/
1483+ void ScaTra::ScaTraTimIntImpl::set_fine_scale_velocity (
1484+ const Core::LinAlg::Vector<double >& fine_scale_velocity) const
1485+ {
1486+ // time measurement
1487+ TEUCHOS_FUNC_TIME_MONITOR (" SCATRA: set fine scale velocity field" );
1488+
1489+ // checks
1490+ FOUR_C_ASSERT (velocity_field_type_ == Inpar::ScaTra::velocity_Navier_Stokes,
1491+ " Wrong set_velocity_field() called for velocity field type {}!" , velocity_field_type_);
1492+ FOUR_C_ASSERT (nds_vel () < discret_->num_dof_sets (), " Too few dof sets on scatra discretization!" );
1493+
1494+ // provide scatra discretization with fine-scale convective velocity if required
1495+ discret_->set_state (nds_vel (), " fine-scale velocity field" , fine_scale_velocity);
1496+ }
1497+
1498+ /* ----------------------------------------------------------------------*
1499+ *----------------------------------------------------------------------*/
1500+ bool ScaTra::ScaTraTimIntImpl::fine_scale_velocity_field_required () const
1501+ {
1502+ // for smagorinsky_all, the fine scale velocity is not necessary
1503+ if (fssgd_ == Inpar::ScaTra::fssugrdiff_smagorinsky_all) return false ;
1504+
1505+ // in case the fine-scale subgrid-viscosity is turned off in the scalar field, the fine scale
1506+ // velocity is not necessary
1507+ if (turbmodel_ == Inpar::FLUID::no_model and fssgd_ == Inpar::ScaTra::fssugrdiff_no) return false ;
1508+
1509+ // do not communicate the fine scale velocity field before it was calculated, i.e., in the initial
1510+ // step
1511+ if (step_ < 1 ) return false ;
1512+
1513+ return true ;
1514+ }
14811515
14821516/* ----------------------------------------------------------------------*
14831517 *----------------------------------------------------------------------*/
14841518void ScaTra::ScaTraTimIntImpl::set_velocity_field (
14851519 std::shared_ptr<const Core::LinAlg::Vector<double >> acc,
1486- std::shared_ptr<const Core::LinAlg::Vector<double >> vel,
1487- std::shared_ptr<const Core::LinAlg::Vector<double >> fsvel)
1520+ std::shared_ptr<const Core::LinAlg::Vector<double >> vel)
14881521{
14891522 // time measurement
14901523 TEUCHOS_FUNC_TIME_MONITOR (" SCATRA: set velocity fields" );
@@ -1494,33 +1527,11 @@ void ScaTra::ScaTraTimIntImpl::set_velocity_field(
14941527 " Wrong set_velocity_field() called for velocity field type {}!" , velocity_field_type_);
14951528 FOUR_C_ASSERT (nds_vel () < discret_->num_dof_sets (), " Too few dof sets on scatra discretization!" );
14961529
1497- // boolean indicating whether fine-scale velocity vector exists
1498- // -> if yes, multifractal subgrid-scale modeling is applied
1499- bool fsvelswitch = (fsvel != nullptr );
1500-
1501- // some thing went wrong if we want to use multifractal subgrid-scale modeling
1502- // and have not got the fine-scale velocity
1503- if (step_ >= 1 and
1504- (turbmodel_ == Inpar::FLUID::multifractal_subgrid_scales or
1505- fssgd_ == Inpar::ScaTra::fssugrdiff_smagorinsky_small) and
1506- not fsvelswitch)
1507- FOUR_C_THROW (" Fine-scale velocity expected for multifractal subgrid-scale modeling!" );
1508- // as fsvelswitch is also true for smagorinsky_all, we have to reset fsvelswitch
1509- // as the corresponding vector, which is not necessary, is not provided in scatra
1510- if (fssgd_ == Inpar::ScaTra::fssugrdiff_smagorinsky_all and fsvelswitch) fsvelswitch = false ;
1511- // as fsvelswitch is true in case of turned-off model in scalar field,
1512- // we have to ensure false
1513- if (turbmodel_ == Inpar::FLUID::no_model and fssgd_ == Inpar::ScaTra::fssugrdiff_no)
1514- fsvelswitch = false ;
1515-
15161530 // provide scatra discretization with velocity
15171531 if (vel != nullptr ) discret_->set_state (nds_vel (), " velocity field" , *vel);
15181532
15191533 // provide scatra discretization with acceleration field if required
15201534 if (acc != nullptr ) discret_->set_state (nds_vel (), " acceleration field" , *acc);
1521-
1522- // provide scatra discretization with fine-scale convective velocity if required
1523- if (fsvelswitch) discret_->set_state (nds_vel (), " fine-scale velocity field" , *fsvel);
15241535}
15251536
15261537/* ----------------------------------------------------------------------*
0 commit comments