diff --git a/MaterialLib/MPL/Properties/CreateTemperatureDependentFraction.cpp b/MaterialLib/MPL/Properties/CreateTemperatureDependentFraction.cpp index 00209dbc9ed153e9369fddd64dcd85a585f8cb23..2ef426b011bd2d1c3149eb0821b9df553ff236aa 100644 --- a/MaterialLib/MPL/Properties/CreateTemperatureDependentFraction.cpp +++ b/MaterialLib/MPL/Properties/CreateTemperatureDependentFraction.cpp @@ -22,8 +22,7 @@ createTemperatureDependentFraction(BaseLib::ConfigTree const& config) //! \ogs_file_param{properties__property__name} auto property_name = config.peekConfigParameter<std::string>("name"); - DBUG("Create temperature dependent fraction property {:s}.", - property_name); + DBUG("Create temperature dependent fraction property {:s}.", property_name); auto const k = //! \ogs_file_param{properties__property__TemperatureDependentFraction__steepness} @@ -33,8 +32,7 @@ createTemperatureDependentFraction(BaseLib::ConfigTree const& config) //! \ogs_file_param{properties__property__TemperatureDependentFraction__characteristic_temperature} config.getConfigParameter<double>("characteristic_temperature"); - return std::make_unique< - MaterialPropertyLib::TemperatureDependentFraction>( + return std::make_unique<MaterialPropertyLib::TemperatureDependentFraction>( std::move(property_name), k, T_c); } } // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/Properties/CreateVolumeFractionAverage.cpp b/MaterialLib/MPL/Properties/CreateVolumeFractionAverage.cpp index 2944104327189957138fdadeac382ad79d87c77f..92c0b354cf9ca0d302c4a7a6760784e56393518e 100644 --- a/MaterialLib/MPL/Properties/CreateVolumeFractionAverage.cpp +++ b/MaterialLib/MPL/Properties/CreateVolumeFractionAverage.cpp @@ -12,8 +12,8 @@ namespace MaterialPropertyLib { -std::unique_ptr<VolumeFractionAverage> -createVolumeFractionAverage(BaseLib::ConfigTree const& config) +std::unique_ptr<VolumeFractionAverage> createVolumeFractionAverage( + BaseLib::ConfigTree const& config) { //! \ogs_file_param{properties__property__type} config.checkConfigParameter("type", "VolumeFractionAverage"); @@ -27,8 +27,7 @@ createVolumeFractionAverage(BaseLib::ConfigTree const& config) // no input parameters required here (taken from phase properties) - return std::make_unique< - MaterialPropertyLib::VolumeFractionAverage>( + return std::make_unique<MaterialPropertyLib::VolumeFractionAverage>( std::move(property_name)); } } // namespace MaterialPropertyLib diff --git a/NumLib/ODESolver/NonlinearSolver.cpp b/NumLib/ODESolver/NonlinearSolver.cpp index ea7b9da1692390f7eccd6367dd9ae0eaf9f76e6b..93ca4a375f14ad707f409f97760913d1fef07bde 100644 --- a/NumLib/ODESolver/NonlinearSolver.cpp +++ b/NumLib/ODESolver/NonlinearSolver.cpp @@ -123,8 +123,8 @@ NonlinearSolverStatus NonlinearSolver<NonlinearSolverTag::Picard>::solve( if (!sys.isLinear() && _convergence_criterion->hasResidualCheck()) { GlobalVector res; - LinAlg::matMult(A, x_new_process, res); // res = A * x_new - LinAlg::axpy(res, -1.0, rhs); // res -= rhs + LinAlg::matMult(A, x_new_process, res); // res = A * x_new + LinAlg::axpy(res, -1.0, rhs); // res -= rhs _convergence_criterion->checkResidual(res); } diff --git a/ProcessLib/BoundaryConditionAndSourceTerm/Python/BHEInflowPythonBoundaryConditionModule.cpp b/ProcessLib/BoundaryConditionAndSourceTerm/Python/BHEInflowPythonBoundaryConditionModule.cpp index 0adae93753e6f92156298e723e014fbbc6438e3a..9cb70a7da4e05d82ec2cbc2624d82b1efbb6309e 100644 --- a/ProcessLib/BoundaryConditionAndSourceTerm/Python/BHEInflowPythonBoundaryConditionModule.cpp +++ b/ProcessLib/BoundaryConditionAndSourceTerm/Python/BHEInflowPythonBoundaryConditionModule.cpp @@ -49,7 +49,8 @@ public: tespySolver, t, Tin_val, Tout_val); } - std::tuple<std::vector<double>, std::vector<double>> serverCommunicationPreTimestep( + std::tuple<std::vector<double>, std::vector<double>> + serverCommunicationPreTimestep( double const t, double const dt, std::vector<double> const& Tin_val, std::vector<double> const& Tout_val, std::vector<double> const& flowrate) const override @@ -60,14 +61,15 @@ public: serverCommunicationPreTimestep, t, dt, Tin_val, Tout_val, flowrate); } - void serverCommunicationPostTimestep(double const t, double const dt, - std::vector<double> const& Tin_val, - std::vector<double> const& Tout_val, - std::vector<double> const& flowrate) const override + void serverCommunicationPostTimestep( + double const t, double const dt, std::vector<double> const& Tin_val, + std::vector<double> const& Tout_val, + std::vector<double> const& flowrate) const override { - PYBIND11_OVERLOAD( - void, BHEInflowPythonBoundaryConditionPythonSideInterface, - serverCommunicationPostTimestep, t, dt, Tin_val, Tout_val, flowrate); + PYBIND11_OVERLOAD(void, + BHEInflowPythonBoundaryConditionPythonSideInterface, + serverCommunicationPostTimestep, t, dt, Tin_val, + Tout_val, flowrate); } }; diff --git a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp index b2718c31d13e35fd5fb4ad47627dab6d2c46e619..813cad12ff787f4f2075094b69389cd475b57f06 100644 --- a/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp +++ b/ProcessLib/HeatTransportBHE/BHE/CreateFlowAndTemperatureControl.cpp @@ -119,8 +119,8 @@ FlowAndTemperatureControl createFlowAndTemperatureControl( "Required flow rate curve not found."); return PowerCurveFlowCurve{power_curve, flow_rate_curve, - refrigerant.specific_heat_capacity, - refrigerant.density}; + refrigerant.specific_heat_capacity, + refrigerant.density}; } if (type == "BuildingPowerCurveConstantFlow") diff --git a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp index e8ed0470a34fe0db829046d70f9d97c2d1363f0c..d0c98f49afd78a9de707868c2c516c5e8801560b 100644 --- a/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp +++ b/ProcessLib/HeatTransportBHE/HeatTransportBHEProcess.cpp @@ -287,8 +287,8 @@ void HeatTransportBHEProcess::preTimestepConcreteProcess( // Transfer T_out to server_Communication and get back T_in and flowrate auto const server_communication_result = - _process_data.py_bc_object->serverCommunicationPreTimestep(t, dt, Tin_value, - Tout_value, flowrate); + _process_data.py_bc_object->serverCommunicationPreTimestep( + t, dt, Tin_value, Tout_value, flowrate); if (!_process_data.py_bc_object ->isOverriddenServerCommunicationPreTimestep()) { @@ -335,8 +335,8 @@ void HeatTransportBHEProcess::postTimestepConcreteProcess( } // Transfer T_out to server_Communication - _process_data.py_bc_object->serverCommunicationPostTimestep(t, dt, Tin_value, - Tout_value, flowrate); + _process_data.py_bc_object->serverCommunicationPostTimestep( + t, dt, Tin_value, Tout_value, flowrate); if (!_process_data.py_bc_object ->isOverriddenServerCommunicationPostTimestep()) { diff --git a/ProcessLib/Output/Output.cpp b/ProcessLib/Output/Output.cpp index 2378b4257fe2a83118e44ea9b7e9761ea42ffdef..6cfb0e88a01b2de2cb33a63e5537dc75bbe5c910 100644 --- a/ProcessLib/Output/Output.cpp +++ b/ProcessLib/Output/Output.cpp @@ -58,7 +58,6 @@ void addBulkMeshNodePropertyToSubMesh(MeshLib::Mesh const& bulk_mesh, { return bulk_mesh_property[id]; }); } - bool Output::isOutputStep(int timestep, double const t) const { auto const fixed_output_time = std::lower_bound( diff --git a/Tests/MaterialLib/TestSpecificHeatCapacityWithLatentHeat.cpp b/Tests/MaterialLib/TestSpecificHeatCapacityWithLatentHeat.cpp index cc77141eb1caf2583149b73893ff21e69bbe4de3..c37f0f7c7d607e789514eb09a282389bad2f103e 100644 --- a/Tests/MaterialLib/TestSpecificHeatCapacityWithLatentHeat.cpp +++ b/Tests/MaterialLib/TestSpecificHeatCapacityWithLatentHeat.cpp @@ -19,20 +19,21 @@ struct IceWaterRockParameters { double const k = 1; - double const T_c = 273.15; // K - double const rho_I = 900; // kg/m³ - double const rho_W = 1000; // kg/m³ - double const rho_R = 3000; // kg/m³ - double const kap_I = 2.37; // W/m/K - double const kap_W = 0.54; // W/m/K - double const kap_R = 3.00; // W/m/K - double const cp_I = 2052; // J/kg/K - double const cp_W = 4186; // J/kg/K - double const cp_R = 2500; // J/kg/K - double const L_IW = 334.e3; // J/kg + double const T_c = 273.15; // K + double const rho_I = 900; // kg/m³ + double const rho_W = 1000; // kg/m³ + double const rho_R = 3000; // kg/m³ + double const kap_I = 2.37; // W/m/K + double const kap_W = 0.54; // W/m/K + double const kap_R = 3.00; // W/m/K + double const cp_I = 2052; // J/kg/K + double const cp_W = 4186; // J/kg/K + double const cp_R = 2500; // J/kg/K + double const L_IW = 334.e3; // J/kg }; -std::unique_ptr<MaterialPropertyLib::Medium> createMyMedium(double L_IW, double porosity) +std::unique_ptr<MaterialPropertyLib::Medium> createMyMedium(double L_IW, + double porosity) { std::stringstream prj; IceWaterRockParameters water_ice_rock; @@ -161,7 +162,8 @@ TEST(MaterialPropertyLib, SpecificHeatCapacityWithLatentHeat_trivial) MaterialPropertyLib::PropertyType::specific_heat_capacity) .template value<double>(vars, pos, t, dt); auto const Capp_expected = Cvol_mix / rho_mix; - auto const relativeError = std::fabs((Capp_expected - Capp) / Capp_expected); + auto const relativeError = + std::fabs((Capp_expected - Capp) / Capp_expected); ASSERT_LE(relativeError, 1e-10) << "for expected apparent heat capacity " << Capp_expected @@ -182,8 +184,9 @@ TEST(MaterialPropertyLib, SpecificHeatCapacityWithLatentHeat_atTc) // at the critical temperature the frozen and the liquid phase have same // volume fractions of 0.5 - auto const rho_mix = phi * 0.5 * (water_ice_rock.rho_I + water_ice_rock.rho_W) - + (1 - phi) * water_ice_rock.rho_R; + auto const rho_mix = + phi * 0.5 * (water_ice_rock.rho_I + water_ice_rock.rho_W) + + (1 - phi) * water_ice_rock.rho_R; auto const Cvol_mix = phi * 0.5 * @@ -197,9 +200,11 @@ TEST(MaterialPropertyLib, SpecificHeatCapacityWithLatentHeat_atTc) auto const Capp = medium->property(MPL::PropertyType::specific_heat_capacity) .template value<double>(vars, pos, t, dt); - auto const Capp_expected = - (Cvol_mix + water_ice_rock.L_IW * rho_mix * phi * water_ice_rock.k / 4) / rho_mix; - auto const relativeError = std::fabs((Capp_expected - Capp) / Capp_expected); + auto const Capp_expected = (Cvol_mix + water_ice_rock.L_IW * rho_mix * phi * + water_ice_rock.k / 4) / + rho_mix; + auto const relativeError = + std::fabs((Capp_expected - Capp) / Capp_expected); ASSERT_LE(relativeError, 1e-10) << "for expected apparent heat capacity " << Capp_expected @@ -225,7 +230,8 @@ TEST(MaterialPropertyLib, SpecificHeatCapacityWithLatentHeat_belowTc) medium->property(MPL::PropertyType::specific_heat_capacity) .template value<double>(vars, pos, t, dt); auto const Capp_expected = water_ice_rock.cp_I; - auto const relativeError = std::fabs((Capp_expected - Capp) / Capp_expected); + auto const relativeError = + std::fabs((Capp_expected - Capp) / Capp_expected); ASSERT_LE(relativeError, 1e-10) << "for expected apparent heat capacity " << Capp_expected @@ -251,7 +257,8 @@ TEST(MaterialPropertyLib, SpecificHeatCapacityWithLatentHeat_aboveTc) medium->property(MPL::PropertyType::specific_heat_capacity) .template value<double>(vars, pos, t, dt); auto const Capp_expected = water_ice_rock.cp_W; - auto const relativeError = std::fabs((Capp_expected - Capp) / Capp_expected); + auto const relativeError = + std::fabs((Capp_expected - Capp) / Capp_expected); ASSERT_LE(relativeError, 1e-10) << "for expected apparent heat capacity " << Capp_expected diff --git a/Tests/MaterialLib/TestTemperatureDependentFraction.cpp b/Tests/MaterialLib/TestTemperatureDependentFraction.cpp index 3c58e610b93f850e70d57cb1e048a475c9ecdb62..848b468c9966e385b816221bab6f05b36beb6857 100644 --- a/Tests/MaterialLib/TestTemperatureDependentFraction.cpp +++ b/Tests/MaterialLib/TestTemperatureDependentFraction.cpp @@ -13,19 +13,18 @@ #include <sstream> /* Keep for debugging -#include <iostream> #include <fstream> +#include <iostream> */ #include "MaterialLib/MPL/Properties/TemperatureDependentFraction.h" - #include "TestMPL.h" #include "Tests/TestTools.h" struct ParameterSet { double const k = 1; - double const T_c = 273.15; // K + double const T_c = 273.15; // K }; std::unique_ptr<MaterialPropertyLib::Medium> createMyMedium() @@ -118,13 +117,15 @@ TEST(MaterialPropertyLib, TemperatureDependentFraction_value_atTc) vars.temperature = water_ice.T_c; - auto const phi = medium->property(MaterialPropertyLib::PropertyType::porosity).template - value<double>(vars, pos, time, dt); + auto const phi = + medium->property(MaterialPropertyLib::PropertyType::porosity) + .template value<double>(vars, pos, time, dt); // calculate the temperature dependent (e.g. frozen) part of the pore space auto const pfr_expected = phi * 0.5; - auto const pfr = medium->property(MaterialPropertyLib::PropertyType::volume_fraction).template - value<double>(vars, pos, time, dt); + auto const pfr = + medium->property(MaterialPropertyLib::PropertyType::volume_fraction) + .template value<double>(vars, pos, time, dt); auto const relativeError = std::fabs((pfr_expected - pfr) / pfr_expected); @@ -147,17 +148,20 @@ TEST(MaterialPropertyLib, TemperatureDependentFraction_dValue_atTc) vars.temperature = water_ice.T_c; - auto const phi = medium->property(MaterialPropertyLib::PropertyType::porosity).template - value<double>(vars, pos, time, dt); + auto const phi = + medium->property(MaterialPropertyLib::PropertyType::porosity) + .template value<double>(vars, pos, time, dt); - // calculate temperature-derivative of temperature dependent (e.g. frozen) volume fraction - auto const dpfr_dT_expected = - phi * water_ice.k * 0.25; + // calculate temperature-derivative of temperature dependent (e.g. frozen) + // volume fraction + auto const dpfr_dT_expected = -phi * water_ice.k * 0.25; auto const dpfr_dT = medium->property(MaterialPropertyLib::PropertyType::volume_fraction) .template dValue<double>(vars, MPL::Variable::temperature, pos, time, dt); - auto const relativeError = std::fabs((dpfr_dT_expected - dpfr_dT) / dpfr_dT_expected); + auto const relativeError = + std::fabs((dpfr_dT_expected - dpfr_dT) / dpfr_dT_expected); ASSERT_LE(relativeError, 1e-10) << "for expected apparent heat capacity " << dpfr_dT_expected diff --git a/Tests/MaterialLib/TestVolumeFractionAverage.cpp b/Tests/MaterialLib/TestVolumeFractionAverage.cpp index c4472527719a6fd167212f2b566fad60ea12617e..37fac9b2248eb64a8ab753ef974a377dceae5586 100644 --- a/Tests/MaterialLib/TestVolumeFractionAverage.cpp +++ b/Tests/MaterialLib/TestVolumeFractionAverage.cpp @@ -10,6 +10,7 @@ */ #include <gtest/gtest.h> + #include <sstream> #include "MaterialLib/MPL/Utils/FormEigenTensor.h" @@ -98,8 +99,9 @@ TEST(MaterialPropertyLib, VolumeFractionAverage_Density) MaterialPropertyLib::VariableArray vars; vars.temperature = water_ice_rock.T_c; - auto const& phi = medium->property(MaterialPropertyLib::PropertyType::porosity) - .template value<double>(vars, pos, time, dt); + auto const& phi = + medium->property(MaterialPropertyLib::PropertyType::porosity) + .template value<double>(vars, pos, time, dt); auto rho_m = medium->property(MaterialPropertyLib::PropertyType::density) .template value<double>(vars, pos, time, dt); @@ -212,11 +214,14 @@ TEST(MaterialPropertyLib, VolumeFractionAverage_ThermalConductivity) MaterialPropertyLib::VariableArray vars; vars.temperature = water_ice_rock.T_c; - auto const& phi = medium->property(MaterialPropertyLib::PropertyType::porosity) - .template value<double>(vars, pos, time, dt); + auto const& phi = + medium->property(MaterialPropertyLib::PropertyType::porosity) + .template value<double>(vars, pos, time, dt); - auto kap_m = medium->property(MaterialPropertyLib::PropertyType::thermal_conductivity) - .template value<double>(vars, pos, time, dt); + auto kap_m = + medium + ->property(MaterialPropertyLib::PropertyType::thermal_conductivity) + .template value<double>(vars, pos, time, dt); auto const kap_expected = (1 - phi) * water_ice_rock.kap_R +