Skip to content

Commit

Permalink
add get_wall_properties
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebbruno committed Aug 21, 2024
1 parent 9b0dcf7 commit 45f922c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/alfasim_sdk/alfasim_sdk_api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,51 @@ DLL_EXPORT int get_liq_liq_flow_pattern_input_variable(
void* ctx, double* out, const char* var_name, int phase_id
);

/*!
Gets the wall names and wall properties for a given control volume. The wall names will be given
as an array of char pointers and the properties by an array data pointer. This method also provide the
size of the given arrays.
IMPORTANT:
The given wall can be a fluid or solid, be aware of this when you start to use the properties.
List of fluid properties:
- Volumetric Thermal Expansion
- Dynamic Viscosity
List of `prop_name`:
- `"layer_thickness"`: Wall Layer Thickness [m]
- `"rho"`: Wall Density [kg/m3]
- `"cp"`: Wall Specific Heat Capacity [J/kg.K]
- `"volumetric_thermal_expansion"`: Wall Volumetric Thermal Expansion [1/K]
- `"cP"`: Wall dynamic viscosity [cP]
- `"k"` : Wall Thermal Conductivity [W/m.degC]
- `"layer_is_fluid"`: Informs if the wall is a fluid [1 - is fluid; 0 - is not fluid]
Example of usage:
[prop_wall_4]
[prop_wall_3] [prop_wall_3]
[prop_wall_2] [prop_wall_2] [prop_wall_2]
[prop_wall_1] [prop_wall_1] [prop_wall_1]
[prop_wall_0] [prop_wall_0] [prop_wall_0]
| | |
---[control_volume_1]--[control_volume_2]--[control_volume_3]--> (Pipe)
~~~~~{.cpp}
errcode = get_wall_properties(
ctx, &wall_names, &prop_values, "layer_thickness", control_volume_id, &size_wall);
~~~~~
@param[in] ctx ALFAsim's plugins context.
@param[out] wall_names Wall names values array.
@param[out] prop_values Wall properties values array.
@param[in] prop_name String with the property name. See the list of possible values above.
@param[in] control_volume Control volume id.
@param[out] size Size of the `wall_names` and `prop_values` array of values.
@return An #error_code value.
*/
DLL_EXPORT int get_wall_properties(void* ctx, char*** wall_names, void** prop_values, const char* prop_name, int control_volume, int* size);

/*!
Gets the current input data for liquid effective viscosity calculation. Any available variable by
this function is considered for a control volume, which means that there are variables with one
Expand Down
10 changes: 10 additions & 0 deletions src/alfasim_sdk/alfasim_sdk_api/detail/api_pointers.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ using get_wall_interfaces_temperature_func = int (*)(
enum TimestepScope ts_scope,
int* size
);
using get_wall_properties_func = int (*) (
void* ctx,
char*** wall_names,
void** prop_values,
const char* prop_name,
int control_volume,
int* size
);
using get_flow_pattern_func = int (*)(
void* ctx,
int** out,
Expand Down Expand Up @@ -154,6 +162,8 @@ struct ALFAsimSDK_API {

get_wall_interfaces_temperature_func get_wall_interfaces_temperature;

get_wall_properties_func get_wall_properties;

get_input_variable_func get_ucm_friction_factor_input_variable;
get_ucm_fluid_geometrical_properties_func get_ucm_fluid_geometrical_properties;
get_input_variable_func get_liq_liq_flow_pattern_input_variable;
Expand Down
1 change: 1 addition & 0 deletions src/alfasim_sdk/alfasim_sdk_api/detail/bootstrap_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ inline int alfasim_sdk_open(ALFAsimSDK_API* api)
api->get_simulation_tracer_array = (get_simulation_tracer_array_func)dlsym(api->handle, "get_simulation_tracer_array");
api->get_simulation_quantity = (get_simulation_quantity_func)dlsym(api->handle, "get_simulation_quantity");
api->get_wall_interfaces_temperature = (get_wall_interfaces_temperature_func)dlsym(api->handle, "get_wall_interfaces_temperature");
api->get_wall_properties = (get_wall_properties_func)dlsym(api->handle, "get_wall_properties");
api->get_flow_pattern = (get_flow_pattern_func)dlsym(api->handle, "get_flow_pattern");
api->get_liqliq_flow_pattern = (get_flow_pattern_func)dlsym(api->handle, "get_liqliq_flow_pattern");
api->get_deposition_thickness = (get_deposition_thickness_func)dlsym(api->handle, "get_deposition_thickness");
Expand Down
1 change: 1 addition & 0 deletions src/alfasim_sdk/alfasim_sdk_api/detail/bootstrap_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ inline int alfasim_sdk_open(ALFAsimSDK_API* api)
api->get_simulation_tracer_array = (get_simulation_tracer_array_func)GetProcAddress(api->handle, "get_simulation_tracer_array");
api->get_simulation_quantity = (get_simulation_quantity_func)GetProcAddress(api->handle, "get_simulation_quantity");
api->get_wall_interfaces_temperature = (get_wall_interfaces_temperature_func)GetProcAddress(api->handle, "get_wall_interfaces_temperature");
api->get_wall_properties = (get_wall_properties_func)GetProcAddress(api->handle, "get_wall_properties");
api->get_flow_pattern = (get_flow_pattern_func)GetProcAddress(api->handle, "get_flow_pattern");
api->get_liqliq_flow_pattern = (get_flow_pattern_func)GetProcAddress(api->handle, "get_liqliq_flow_pattern");
api->get_deposition_thickness = (get_deposition_thickness_func)GetProcAddress(api->handle, "get_deposition_thickness");
Expand Down

0 comments on commit 45f922c

Please sign in to comment.