/*============================================================================ * Definition of turbomachinery related options. * * Turbomachinery-related user functions (called in this order): * 1) Define rotor cells and associated axis *============================================================================*/ /* Code_Saturne version 5.0.7 */ /* This file is part of Code_Saturne, a general-purpose CFD tool. Copyright (C) 1998-2018 EDF S.A. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /*----------------------------------------------------------------------------*/ #include "cs_defs.h" /*---------------------------------------------------------------------------- * Standard C library headers *----------------------------------------------------------------------------*/ #include #include #include #include #include #include /*---------------------------------------------------------------------------- * Local headers *----------------------------------------------------------------------------*/ #include "bft_error.h" #include "bft_mem.h" #include "bft_printf.h" #include "cs_base.h" #include "cs_mesh.h" #include "cs_parall.h" #include "cs_turbomachinery.h" /*---------------------------------------------------------------------------- * Header for the current file *----------------------------------------------------------------------------*/ #include "cs_prototypes.h" /*----------------------------------------------------------------------------*/ BEGIN_C_DECLS /*----------------------------------------------------------------------------*/ /*! * \file cs_user_turbomachinery.c * * \brief Definition of turbomachinery related options. * * See \subpage turbomachinery for examples. */ /*----------------------------------------------------------------------------*/ /*============================================================================ * User function definitions *============================================================================*/ /*---------------------------------------------------------------------------- * Define rotor/stator model. *----------------------------------------------------------------------------*/ void cs_user_turbomachinery(void) { /*! [user_tbm_set_model] */ /* Set turbomachinery model type: CS_TURBOMACHINERY_NONE, No turbomachinery modeling CS_TURBOMACHINERY_FROZEN, Frozen rotor model CS_TURBOMACHINERY_TRANSIENT Full transient simulation */ cs_turbomachinery_set_model(CS_TURBOMACHINERY_TRANSIENT); /*! [user_tbm_set_model] */ } /*---------------------------------------------------------------------------- * Define rotor axes, associated cells, and rotor/stator faces. *----------------------------------------------------------------------------*/ matrix[3][4] = {{1., 0., 0., 0.}, {0., 1., 0., 0.5}, {0., 0., 1., 0.}}; void cs_user_turbomachinery_rotor(void) { /* Define rotor axis and cells, with rotor/stator interface face joining */ /* --------------------------------------------------------------------- */ /*! [user_tbm_set_rotor] */ { /* Define cells belonging to rotor and associated axis */ double rotation_velocity = 0.; double rotation_axis[3] = {0., 0., 0.}; double rotation_invariant[3] = {0., 0., 0.}; const char cell_criteria[] = "Symmetry"; cs_turbomachinery_add_rotor(cell_criteria, rotation_velocity, rotation_axis, rotation_invariant); } /*! [user_tbm_set_rotor] */ /*! [user_tbm_set_interface] */ { /* Define joining associated with rotor/stator interface */ const char faces_criteria[] = "Coupling"; int verbosity = 1; /* per-task dump if > 1, debug level if >= 3 */ int visualization = 1; /* debug level if >= 3 */ float fraction = 0.05, plane = 25.; int join_num = cs_turbomachinery_join_add(faces_criteria, fraction, plane, verbosity, visualization); /* Note that advanced parameters may be defined using cs_join_set_advanced_param(), just as for regular joinings or periodicities. */ } /*! [user_tbm_set_interface] */ } /*----------------------------------------------------------------------------*/ END_C_DECLS