Welcome to StoveOpt’s documentation!¶
Created on Mon Apr 22 15:39:27 2019
@author: Lee
-
StoveOpt.import_geometry.
correct_arguments
(args)[source]¶ Goal is to convert the geometry file argument to working syntax: Single quote, back slash
Parameters: args – object contains the contents of the input file specified by the user
-
StoveOpt.import_geometry.
create_additional_front_points
(pt6x, pt7x, pt14x, pt9z, pt15x, pt8z, pt14z, pt9x, pt8x, pt15z)[source]¶ Create pot surface points to create faces–Naming them 21(L)-22(R) to not collide with current fuel vert numbers
-
StoveOpt.import_geometry.
create_back_points
(shift, pt1xstr, pt1zstr, pt1ystr, pt2xstr, pt2zstr, pt2ystr, pt3xstr, pt3zstr, pt3ystr, pt4xstr, pt4zstr, pt4ystr, pt5xstr, pt5zstr, pt5ystr, pt6xstr, pt6zstr, pt6ystr, pt7xstr, pt7zstr, pt7ystr, pt8xstr, pt8zstr, pt8ystr, pt9xstr, pt9zstr, pt9ystr, pt10xstr, pt10zstr, pt10ystr, pt11xstr, pt11zstr, pt11ystr, pt12xstr, pt12zstr, pt12ystr, pt13xstr, pt13zstr, pt13ystr, pt14xstr, pt14zstr, pt14ystr, pt15xstr, pt15zstr, pt15ystr, pt0xstr, pt0zstr, pt0ystr, pt16xstr, pt16zstr, pt16ystr, pt17xstr, pt17zstr, pt17ystr, pt18xstr, pt18zstr, pt18ystr, pt19xstr, pt19zstr, pt19ystr, pt20xstr, pt20zstr, pt20ystr, pt21xstr, pt21zstr, pt21ystr, pt44xstr, pt44zstr, pt44ystr, pt46xstr, pt46zstr, pt46ystr, pt48xstr, pt48zstr, pt48ystr, pt50xstr, pt50ystr, pt50zstr)[source]¶ Back coordinates of the cookstove–simply shifting the x2 (y) coordinate back by a value shift
-
StoveOpt.import_geometry.
create_fuel_blocks
(pt0x, pt1x)[source]¶ Creates geometry for the fuel block with the following assumptions: Rectangular fuel source, Centered along the vertical axis of the combustion chamber, Width of fuel block is half the diameter of the combustion chamber, Assumed fuel height of 3 inches (0.0762 m), bottom of the fuel is 3 inches off the ground.
Parameters: - pt0x – Type: float. Bottom west vertice of the cookstove combustion chamber (origin)
- pt1x – Type: float. Bottom east vertice of cookstove combustion chamber
-
StoveOpt.import_geometry.
extract_geometry
(file_path)[source]¶ Pulling Data from excel workbook
Parameters: file_path – Windows format filepath with filename superimposed to the path. Tied to the input file
-
StoveOpt.import_geometry.
locate_geometry
(args)[source]¶ Pull file path and name from the input file (command line argument)
Parameters: agrs – Object from argparse that pulls filename and location of the stove geometry
-
StoveOpt.import_geometry.
points_to_strings
(pt1x, pt1z, pt1y, pt2x, pt2z, pt2y, pt3x, pt3z, pt3y, pt4x, pt4z, pt4y, pt5x, pt5z, pt5y, pt6x, pt6z, pt6y, pt7x, pt7z, pt7y, pt8x, pt8z, pt8y, pt9x, pt9z, pt9y, pt10x, pt10z, pt10y, pt11x, pt11z, pt11y, pt12x, pt12z, pt12y, pt13x, pt13z, pt13y, pt14x, pt14z, pt14y, pt15x, pt15z, pt15y, pt0x, pt0z, pt0y, pt17x, pt18x, pt19x, pt16x, pt17z, pt18z, pt19z, pt16z, pt17y, pt18y, pt19y, pt16y, pt20x, pt20z, pt20y, pt21x, pt21z, pt21y, pt44x, pt44z, pt44y, pt46x, pt46z, pt46y, pt48x, pt48y, pt48z, pt50x, pt50y, pt50z)[source]¶ Take in the raw vertice information from spreadsheet, and format the floats into strings->For front vertices
-
StoveOpt.import_geometry.
vertice_concatenate
(pt1xstr, pt1zstr, pt1ystr, pt2xstr, pt2zstr, pt2ystr, pt3xstr, pt3zstr, pt3ystr, pt4xstr, pt4zstr, pt4ystr, pt5xstr, pt5zstr, pt5ystr, pt6xstr, pt6zstr, pt6ystr, pt7xstr, pt7zstr, pt7ystr, pt8xstr, pt8zstr, pt8ystr, pt9xstr, pt9zstr, pt9ystr, pt10xstr, pt10zstr, pt10ystr, pt11xstr, pt11zstr, pt11ystr, pt12xstr, pt12zstr, pt12ystr, pt13xstr, pt13zstr, pt13ystr, pt14xstr, pt14zstr, pt14ystr, pt15xstr, pt15zstr, pt15ystr, pt0xstr, pt0zstr, pt0ystr, pt16xstr, pt16zstr, pt16ystr, pt17xstr, pt17zstr, pt17ystr, pt18xstr, pt18zstr, pt18ystr, pt19xstr, pt19zstr, pt19ystr, pt20xstr, pt20zstr, pt20ystr, pt21xstr, pt21zstr, pt21ystr, pt44xstr, pt44zstr, pt44ystr, pt46xstr, pt46zstr, pt46ystr, pt48xstr, pt48zstr, pt48ystr, pt50xstr, pt50zstr, pt50ystr)[source]¶ Convert the individual vertex strings and concatenate to the format required for blockmeshdict file
Created on Sun May 19 18:18:31 2019
@author: Lee
-
StoveOpt.post_processor.
average_pot_temperature
(list_temps, length_case_list, list_velocities, case_list)[source]¶ Compute average temperatures of each of the case temperature arrays previously extracted with data_import()
Parameters: new_recarr – Numpy array where column 1 is case title (str), second column is velocites for respective case, and third column is computed average pot temperature for specific case
-
StoveOpt.post_processor.
compute_neighboring_velocities
(array_sorted, T_max, velocity_max, T_max_index, length_case_list, velocity_column, temperature_column)[source]¶ Use the maximum data solved for previously to compute 4 new neighboring velocities
Parameters: v_cases_total_vector – Numpy array listing four velocities to be added to the case queue
-
StoveOpt.post_processor.
data_import
()[source]¶ input a list of filenames to be pulled, put out an array of temperature data. search the foamfiles directory for fnames that start with case_ and tally the number for looping through the file. loop through each and pull data from the files (3) convert to numpy arrays (4) store.
Parameters: - dir_list – Dictionary of directory titles in the ‘foamfiles’ directory that begin with string ‘case_’
- case_list – Dictionary of case file paths. Appended iteratively with dir_list entries.
- length_case_list – Type: integer. Number of excecuted case files existing in foamfiles directory
- list_temps – Type: float array. Populated with results from probing the CFD simulation around entire pot geometry
- list_velocities – Type: float array. Populated with velocity values written to “details” file in individual case files
-
StoveOpt.post_processor.
evaluate_optimal
(array_sorted, length_case_list)[source]¶ The function evaluates the temperature and velocity data, and uses the information to identify where the optimals live within the range analayzed
Parameters: - array_sorted – Numpy array of sorted velocities (column 1), and average pot temperatures (column 2)
- T_max – Maximum average pot temperature of all analyzed cases within foamfiles directory
- case_max – Case title associated with maximum average pot temp
- U_optimal – Secondary air flow velocity associated with maximum average pot temperature
-
StoveOpt.post_processor.
parse_and_sort_array
(new_recarr, length_case_list)[source]¶ Sort new_recarr array based on velocities, return the array with a new name
Parameters: array_sorted – Numpy array. Same data as new_recarr, but sorted based on velocities (least to greatest along column 2)
-
StoveOpt.post_processor.
plot_variables
(array_sorted, T_max, velocity_max, T_max_index, velocity_column, temperature_column)[source]¶ create a matplot lib of the data extracted
Created on Thu May 23 11:06:19 2019
@author: Lee
-
StoveOpt.new_case_setup.
add_templates
(full_case_paths)[source]¶ Add the template files to the new case directories
Parameters: - zero_file_paths – List of paths leading to initial condition files for each newly added case
- constant_file_paths – List of paths leading to solver files for each newly added case
- system_file_paths – List of paths leading to mesh, schemes, time step and outfil writing files for each newly added case
-
StoveOpt.new_case_setup.
create_case_directories
(case_name_list)[source]¶ Create the directories for next batch of simulations within the foamfiles dir
Parameters: - case_name_list – List of strings each corresponding to a new case file. Named based on velocity values converted to string.
- full_case_paths – List of full paths for new cases to be added. Compatible with windows os.
-
StoveOpt.new_case_setup.
define_new_case_names
(v_cases_total_vector)[source]¶ Create new case_ folders in the foamfiles folder. Named based on velocities computed in post_processor
Parameters: - v_cases_total_vector – Numpy array listing four velocities to be added to the case queue
- case_name_list – List of strings each corresponding to a new case file. Named based on velocity values converted to string.
- v_cases_total_vector_string – Velocities converted to string dtype
- v_boundary_strings – Velocty data converted to string compatible with boundary condition file
-
StoveOpt.new_case_setup.
edit_details_files
(zero_file_paths, v_boundary_strings)[source]¶ Open and edit the newly created 0 case files. Edit the empty details file with the velocity strings
Parameters: - zero_file_paths – List of paths leading to initial condition files for each newly added case
- v_boundary_strings – Velocity strings to be added to details files for respective case
-
StoveOpt.new_case_setup.
edit_iterative_boundary_conditions
(zero_file_paths, constant_file_paths, system_file_paths, v_boundary_strings)[source]¶ Edit the boundary condition files, U, in the initial condition 0 folder with the new computed velocities