stardis

Perform coupled heat transfer calculations
git clone git://git.meso-star.fr/stardis.git
Log | Files | Refs | README | LICENSE

stardis-fluid-prog.h (2219B)


      1 /* Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef SDIS_FLUID_PROG_H
     17 #define SDIS_FLUID_PROG_H
     18 
     19 #include <rsys/rsys.h>
     20 #include <rsys/str.h>
     21 
     22 #include "stardis-prog-properties.h"
     23 
     24 struct stardis;
     25 struct mem_allocator;
     26 struct program;
     27 
     28 /*******************************************************************************
     29  * Fluid prog data
     30  ******************************************************************************/
     31 struct fluid_prog {
     32   void* prog_data; /* result of the create() call */
     33   struct str name;
     34   struct str prog_name;
     35   size_t argc;
     36   char** argv;
     37   int is_outside; /* the fluid is used for a boundary */
     38   unsigned desc_id; /* id of the boundary; meaningful if is_outside */
     39   unsigned fluid_id;
     40   /* lib handle and function ptrs */
     41   struct program* program;
     42   void* (*create)
     43     (const struct stardis_description_create_context*, void*, size_t, char**);
     44   void (*release)(void*);
     45   double (*rho)(const struct stardis_vertex*, void*);
     46   double (*cp)(const struct stardis_vertex*, void*);
     47   double (*temp)(const struct stardis_vertex*, void*);
     48 };
     49 
     50 res_T
     51 create_solver_fluid_prog
     52   (struct stardis* stardis,
     53    const struct fluid_prog* fluid_props);
     54 
     55 res_T
     56 create_solver_external_fluid_prog
     57   (struct stardis* stardis,
     58    const struct fluid_prog* fluid_props);
     59 
     60 res_T
     61 init_fluid_prog
     62   (struct mem_allocator* allocator,
     63    struct fluid_prog** dst);
     64 
     65 void
     66 release_fluid_prog
     67   (struct fluid_prog* fluid,
     68    struct mem_allocator* allocator);
     69 
     70 res_T
     71 str_print_fluid_prog
     72   (struct str* str,
     73    const struct fluid_prog* fluid);
     74 
     75 #endif