From 24464a8fd4a4f14b1ef2e6defed2428ceb49444f Mon Sep 17 00:00:00 2001 From: Malik Date: Wed, 29 Oct 2025 14:14:43 -0600 Subject: [PATCH 1/2] compute Ualpha liquid stats --- applications/compute_conditional_mean_will.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/applications/compute_conditional_mean_will.py b/applications/compute_conditional_mean_will.py index eb27e34f..5d2b2a25 100644 --- a/applications/compute_conditional_mean_will.py +++ b/applications/compute_conditional_mean_will.py @@ -133,7 +133,18 @@ def radial_mean( # Read all the fields you want for filename, field_name in zip(field_file, field_names): val_dict = {} - field_tmp, _ = read_field(case_folder, time_folder, field_name) + try: + field_tmp, _ = read_field(case_folder, time_folder, field_name) + except FileNotFoundError: + if field_name == "Ualpha.liquid": + alpha_tmp, _ = read_field( + case_folder, time_folder, "alpha.liquid" + ) + U_tmp, _ = read_field(case_folder, time_folder, "U.liquid") + else: + raise NotImplementedError( + f"{field_name} is not a valid field name" + ) if len(field_tmp.shape) == 2 and field_tmp.shape[1] == 3: # You read a velocity I'm assuming you need the axial one field_tmp = field_tmp[:, vert_ind] @@ -228,7 +239,7 @@ def make_plot(fields_cond: dict, heights: list[float], field_names=list[str]): fields_cond = radial_mean( case_folder=None, heights=[5.2, 6.2, 6.3], - field_names=["U.liquid", "alpha.gas"], + field_names=["U.liquid", "alpha.gas", "Ualpha.liquid"], vert_ind=1, window_ave=2, n_bins=32, @@ -240,5 +251,5 @@ def make_plot(fields_cond: dict, heights: list[float], field_names=list[str]): make_plot( fields_cond=fields_cond, heights=[5.2, 6.2, 6.3], - field_names=["U.liquid", "alpha.gas"], + field_names=["U.liquid", "alpha.gas", "Ualpha.liquid"], ) From 2a30b4c57caa46621aa675e6a44e58a6e4492770 Mon Sep 17 00:00:00 2001 From: Malik Date: Wed, 29 Oct 2025 14:25:42 -0600 Subject: [PATCH 2/2] forgot to multiply the fields --- applications/compute_conditional_mean_will.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/applications/compute_conditional_mean_will.py b/applications/compute_conditional_mean_will.py index 5d2b2a25..9b86881d 100644 --- a/applications/compute_conditional_mean_will.py +++ b/applications/compute_conditional_mean_will.py @@ -141,12 +141,16 @@ def radial_mean( case_folder, time_folder, "alpha.liquid" ) U_tmp, _ = read_field(case_folder, time_folder, "U.liquid") + field_tmp = alpha_tmp[:, np.newaxis] * U_tmp else: raise NotImplementedError( f"{field_name} is not a valid field name" ) if len(field_tmp.shape) == 2 and field_tmp.shape[1] == 3: # You read a velocity I'm assuming you need the axial one + logger.warning( + f"You read a velocity I'm assuming you need the axial one along the direction {vert_ind}" + ) field_tmp = field_tmp[:, vert_ind] if heights is None: