Skip to content

Commit

Permalink
Modify the name of variable calculate_average_temperature to calculat…
Browse files Browse the repository at this point in the history
…e_average_temp_and_hf
  • Loading branch information
mivaia committed Dec 11, 2024
1 parent b216abf commit 6132041
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions doc/source/parameters/cfd/post_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ This subsection controls the post-processing other than the forces and torque on
set initial time for average velocity = 0.0
# Average temperature calculation
set calculate average temperature = false
set initial time for average temperature = 0.0
set calculate average temperature and average heat flux = false
set initial time for average temperature and average heat flux = 0.0
# Pressure drop calculation
set calculate pressure drop = false
Expand Down Expand Up @@ -110,7 +110,7 @@ This subsection controls the post-processing other than the forces and torque on
* ``calculate average velocities``: controls if calculation of time-averaged velocities is enabled.
* ``initial time for average velocity``: initial time used for the average velocities calculations.

* ``calculate average temperature``: controls if calculation of time-averaged temperature is enabled.
* ``calculate average temperature and average heat flux``: controls if calculation of time-averaged temperature and time-averaged heat flux is enabled.
* ``initial time for average temperature``: initial time used for the average temperature calculations.

* ``calculate pressure drop``: controls if calculation of the pressure drop from the inlet boundary to the outlet boundary is enabled.
Expand Down
4 changes: 2 additions & 2 deletions include/core/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ namespace Parameters
bool calculate_average_velocities;

/// Enable average temperature post-processing
bool calculate_average_temperature;
bool calculate_average_temp_and_hf;

/// Enable pressure drop post-processing
bool calculate_pressure_drop;
Expand All @@ -942,7 +942,7 @@ namespace Parameters
double initial_time_for_average_velocities;

/// Set initial time to start calculations for temperature
double initial_time_for_average_temperature;
double initial_time_for_average_temp_and_hf;

/// Frequency of the calculation of the post-processed quantity
unsigned int calculation_frequency;
Expand Down
2 changes: 1 addition & 1 deletion include/solvers/heat_transfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class HeatTransfer : public AuxiliaryPhysics<dim, GlobalVectorType>
if (simulation_parameters.timer.type == Parameters::Timer::Type::none)
this->computing_timer.disable_output();

if (simulation_parameters.post_processing.calculate_average_temperature){
if (simulation_parameters.post_processing.calculate_average_temp_and_hf){
average_temperature = std::make_shared<AverageScalarInTime<dim>>(this->dof_handler);
}
}
Expand Down
10 changes: 5 additions & 5 deletions source/core/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1843,10 +1843,10 @@ namespace Parameters
Patterns::Bool(),
"Enable calculation of average velocities.");

prm.declare_entry("calculate average temperature",
prm.declare_entry("calculate average temperature and average heat flux",
"false",
Patterns::Bool(),
"Enable calculation of time average temperature");
"Enable calculation of time average temperature and time average heat flux");

prm.declare_entry(
"calculate pressure drop",
Expand Down Expand Up @@ -1882,7 +1882,7 @@ namespace Parameters
"Initial time to start calculations for average velocities");

prm.declare_entry(
"initial time for average temperature",
"initial time for average temperature and average heat flux",
"0.0",
Patterns::Double(),
"Initial time to start calculations for average temperature");
Expand Down Expand Up @@ -2077,14 +2077,14 @@ namespace Parameters
prm.get_bool("calculate apparent viscosity");
calculate_average_velocities =
prm.get_bool("calculate average velocities");
calculate_average_temperature = prm.get_bool("calculate average temperature");
calculate_average_temp_and_hf = prm.get_bool("calculate average temperature and average heat flux");
calculate_pressure_drop = prm.get_bool("calculate pressure drop");
inlet_boundary_id = prm.get_integer("inlet boundary id");
outlet_boundary_id = prm.get_integer("outlet boundary id");
calculate_flow_rate = prm.get_bool("calculate flow rate");
calculate_tracer_flow_rate = prm.get_bool("calculate tracer flow rate");
initial_time_for_average_velocities = prm.get_double("initial time for average velocity");
initial_time_for_average_temperature = prm.get_double("initial time for average temperature");
initial_time_for_average_temp_and_hf = prm.get_double("initial time for average temperature and average heat flux");
kinetic_energy_output_name = prm.get("kinetic energy name");
pressure_drop_output_name = prm.get("pressure drop name");
flow_rate_output_name = prm.get("flow rate name");
Expand Down
14 changes: 7 additions & 7 deletions source/solvers/heat_transfer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ HeatTransfer<dim>::attach_solution_to_output(DataOut<dim> &data_out)
// Add the average heat flux

// Ouput the time average temperature
if (simulation_parameters.post_processing.calculate_average_temperature && this->simulation_control->get_current_time() > simulation_parameters.post_processing.initial_time_for_average_temperature + 1e-12)
if (simulation_parameters.post_processing.calculate_average_temp_and_hf && this->simulation_control->get_current_time() > simulation_parameters.post_processing.initial_time_for_average_temp_and_hf + 1e-12)
{
this->average_temperature->calculate_average_scalar(
this->present_solution,
Expand Down Expand Up @@ -1085,7 +1085,7 @@ HeatTransfer<dim>::pre_mesh_adaptation()
previous_solutions[i]);
}

if (simulation_parameters.post_processing.calculate_average_temperature)
if (simulation_parameters.post_processing.calculate_average_temp_and_hf)
this -> average_temperature->prepare_for_mesh_adaptation();
}

Expand Down Expand Up @@ -1118,7 +1118,7 @@ HeatTransfer<dim>::post_mesh_adaptation()
previous_solutions[i] = tmp_previous_solution;
}

if (simulation_parameters.post_processing.calculate_average_temperature)
if (simulation_parameters.post_processing.calculate_average_temp_and_hf)
this -> average_temperature -> post_mesh_adaptation();
}

Expand Down Expand Up @@ -1164,7 +1164,7 @@ HeatTransfer<dim>::write_checkpoint()
this->simulation_parameters.simulation_control.output_folder +
this->simulation_parameters.restart_parameters.filename;

if (simulation_parameters.post_processing.calculate_average_temperature)
if (simulation_parameters.post_processing.calculate_average_temp_and_hf)
{
std::vector<const GlobalVectorType *> avg_scalar_set_transfer =
this->average_temperature->save(checkpoint_file_prefix);
Expand Down Expand Up @@ -1235,7 +1235,7 @@ HeatTransfer<dim>::read_checkpoint()
this->simulation_parameters.restart_parameters.filename;

// This will need to be changed to the average temperature
if (simulation_parameters.post_processing.calculate_average_temperature)
if (simulation_parameters.post_processing.calculate_average_temp_and_hf)
{
std::vector<GlobalVectorType *> sum_vectors =
this->average_temperature->read(checkpoint_file_prefix);
Expand All @@ -1245,7 +1245,7 @@ HeatTransfer<dim>::read_checkpoint()

solution_transfer->deserialize(input_vectors);

if (simulation_parameters.post_processing.calculate_average_temperature)
if (simulation_parameters.post_processing.calculate_average_temp_and_hf)
this->average_temperature->sanitize_after_restart();

present_solution = distributed_system;
Expand Down Expand Up @@ -1340,7 +1340,7 @@ HeatTransfer<dim>::setup_dofs()
}
}
// Initialize the vectors used in the time average temperature calculation
if (this->simulation_parameters.post_processing.calculate_average_temperature)
if (this->simulation_parameters.post_processing.calculate_average_temp_and_hf)
{
this -> average_temperature -> initialize_vectors(
this->locally_owned_dofs,
Expand Down
2 changes: 1 addition & 1 deletion source/solvers/postprocessing_scalar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ AverageScalarInTime<dim>::calculate_average_scalar(
const double time_step)
{
const double epsilon = 1e-6;
const double initial_time = post_processing.initial_time_for_average_temperature;
const double initial_time = post_processing.initial_time_for_average_temp_and_hf;
dt = time_step;

// When averaging velocities begins
Expand Down
6 changes: 3 additions & 3 deletions tests/solvers/average_scalar_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ test()
simulation_control_parameters.time_step_independent_of_end_time = true;

Parameters::PostProcessing postprocessing_parameters;
postprocessing_parameters.calculate_average_temperature = true;
postprocessing_parameters.initial_time_for_average_temperature = 0.5;
postprocessing_parameters.calculate_average_temp_and_hf = true;
postprocessing_parameters.initial_time_for_average_temp_and_hf = 0.5;

auto simulation_control =
std::make_shared<SimulationControlTransient>(simulation_control_parameters);
Expand Down Expand Up @@ -76,7 +76,7 @@ test()

// Time info
const double time_end = simulation_control_parameters.time_end;
const double initial_time = postprocessing_parameters.initial_time_for_average_temperature;
const double initial_time = postprocessing_parameters.initial_time_for_average_temp_and_hf;
double time = simulation_control->get_current_time();
double epsilon = 1e-6;

Expand Down

0 comments on commit 6132041

Please sign in to comment.