From 9522125ebb96f0f8dc409e49863318be187bdff5 Mon Sep 17 00:00:00 2001 From: ssibirtsev <sibi_ballad@gmx.de> Date: Mon, 6 Jan 2025 15:47:27 +0100 Subject: [PATCH] Upload New File --- script/DropDeform_main.py | 74 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 script/DropDeform_main.py diff --git a/script/DropDeform_main.py b/script/DropDeform_main.py new file mode 100644 index 0000000..f8a5a43 --- /dev/null +++ b/script/DropDeform_main.py @@ -0,0 +1,74 @@ +""" +Droplet Deformation (DropDeform) + +Determine droplet deformation into Polyhedron Shape. + +Source code of DropDeform: https://git.rwth-aachen.de/avt-fvt/public/droplet-deformation/ + +The source code of DropDeform is licensed under the Eclipse Public License v2.0 (EPL 2.0). +Copyright (c) 2025 Fluid Process Engineering (AVT.FVT), RWTH Aachen University. +Written by Stepan Sibirtsev + +The coyprights and license terms are given in LICENSE. + +This is the main script to execute DropDeform. +Script version date: 06.01.2025 +""" + +""" Import packages """ +import os +import warnings +import time +import numpy as np +""" Import configuration """ +import DropDeform_config as config +""" Import polyhedral shape parameters """ +import DropDeform_poly as poly +""" Import droplet deformation model related functions """ +from DropDeform_deform import calc_deform +""" Import Bond number correlation related functions """ +from DropDeform_bo import calc_pars_bo +""" Import data export related functions """ +from DropDeform_excel import save_excel +""" Solver warning messages """ +if config.display_solver_warnings == False: + warnings.filterwarnings("ignore") +""" Simulation starts from here """ +# Time stamp overall simulation +start_sim_total = time.time() +# Assign output file folder +NAME_OUTPUT_FILE = (config.name_output_file + '.xls') +ROOT_DIR_OUTPUT = os.path.abspath("../output") +# Check if the folder exists +if not os.path.exists(ROOT_DIR_OUTPUT): + # Create the folder + os.makedirs(ROOT_DIR_OUTPUT) +""" MAIN """ +if __name__ == "__main__": + # Time stamp deformation caclulation + start_sim_deform = time.time() + # Droplet diameters + d = np.linspace(config.d_min, config.d_max, config.n_steps) + # Pressures + p = np.linspace(config.p_min, config.p_max, config.n_steps) + # Interfacial tensions + sigma = np.linspace(config.sigma_min, config.sigma_max, config.n_steps) + # Define polyhedron shape names + shape_names = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron'] + # Create index mappings + shape_names_ind = {j: shape_names[j] for j in range(len(shape_names))} + # Prediefine matrix to store the deformation parameter and polyhedron volume: M_deform = [Bo, r_a][Bo, r_f][Bo, eps] + # Bo = Bond number + # r_a = droplet's curvature radius normalized by droplet diameter + # r_f = droplet's contact area radius normalized by droplet diameter + # eps = volume ratio between droplet's volume and its polyhedron volume + M_deform = np.zeros((3, config.n_steps**3, 6)) + # Calculate droplet deformation and the corresponding polyhedron parameter: + M_deform = calc_deform(config, poly, p, sigma, d, M_deform, shape_names_ind) + # Determine fitting parameter of Bond correlations + D_bo = calc_pars_bo(config, poly, M_deform, shape_names, shape_names_ind) + """ Save results as Excel sheet. """ + save_excel(ROOT_DIR_OUTPUT, NAME_OUTPUT_FILE, M_deform) + print('Simulation completed') + print('Total simulation time:') + print("--- %s seconds ---" % (time.time() - start_sim_deform)) -- GitLab