diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp index fae147122168..48d3c67886ba 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application.cpp @@ -303,6 +303,17 @@ void KratosGeoMechanicsApplication::Register() { KRATOS_REGISTER_VARIABLE( BULK_MODULUS_SOLID ) KRATOS_REGISTER_VARIABLE( BULK_MODULUS_FLUID ) + KRATOS_REGISTER_VARIABLE( SPECIFIC_HEAT_CAPACITY_WATER ) + KRATOS_REGISTER_VARIABLE( SPECIFIC_HEAT_CAPACITY_SOLID ) + KRATOS_REGISTER_VARIABLE( THERMAL_CONDUCTIVITY_WATER ) + KRATOS_REGISTER_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS( THERMAL_CONDUCTIVITY_SOLID ) + KRATOS_REGISTER_VARIABLE( LONGITUDINAL_DISPERSIVITY ) + KRATOS_REGISTER_VARIABLE( TRANSVERSE_DISPERSIVITY ) + KRATOS_REGISTER_VARIABLE( SOLID_COMPRESSIBILITY ) + KRATOS_REGISTER_VARIABLE( DT_TEMPERATURE_COEFFICIENT ) + KRATOS_REGISTER_VARIABLE( DT_TEMPERATURE ) + KRATOS_REGISTER_VARIABLE( NORMAL_HEAT_FLUX ) + KRATOS_REGISTER_VARIABLE( K0_MAIN_DIRECTION ) KRATOS_REGISTER_VARIABLE( K0_VALUE_XX ) KRATOS_REGISTER_VARIABLE( K0_VALUE_YY ) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp index 8f308c1266e9..4c42069f39cb 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp +++ b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.cpp @@ -30,6 +30,17 @@ KRATOS_CREATE_VARIABLE( double, DENSITY_SOLID ) KRATOS_CREATE_VARIABLE( double, BULK_MODULUS_SOLID ) KRATOS_CREATE_VARIABLE( double, BULK_MODULUS_FLUID ) +KRATOS_CREATE_VARIABLE( double, SPECIFIC_HEAT_CAPACITY_WATER ) +KRATOS_CREATE_VARIABLE( double, SPECIFIC_HEAT_CAPACITY_SOLID ) +KRATOS_CREATE_VARIABLE( double, THERMAL_CONDUCTIVITY_WATER ) +KRATOS_CREATE_SYMMETRIC_3D_TENSOR_VARIABLE_WITH_COMPONENTS(THERMAL_CONDUCTIVITY_SOLID) +KRATOS_CREATE_VARIABLE( double, LONGITUDINAL_DISPERSIVITY ) +KRATOS_CREATE_VARIABLE( double, TRANSVERSE_DISPERSIVITY ) +KRATOS_CREATE_VARIABLE( double, SOLID_COMPRESSIBILITY ) +KRATOS_CREATE_VARIABLE( double, DT_TEMPERATURE_COEFFICIENT ) +KRATOS_CREATE_VARIABLE( double, DT_TEMPERATURE ) +KRATOS_CREATE_VARIABLE( double, NORMAL_HEAT_FLUX ) + KRATOS_CREATE_VARIABLE( int, K0_MAIN_DIRECTION ) KRATOS_CREATE_VARIABLE( double, K0_VALUE_XX ) KRATOS_CREATE_VARIABLE( double, K0_VALUE_YY ) diff --git a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h index cfa1e386f7c0..8197e8505dd3 100644 --- a/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h +++ b/applications/GeoMechanicsApplication/geo_mechanics_application_variables.h @@ -57,6 +57,17 @@ namespace Kratos KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, PERMEABILITY_ZX ) KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, PERMEABILITY_CHANGE_INVERSE_FACTOR ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, SPECIFIC_HEAT_CAPACITY_WATER ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, SPECIFIC_HEAT_CAPACITY_SOLID ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, THERMAL_CONDUCTIVITY_WATER ) + KRATOS_DEFINE_SYMMETRIC_3D_TENSOR_APPLICATION_VARIABLE_WITH_COMPONENTS( GEO_MECHANICS_APPLICATION, THERMAL_CONDUCTIVITY_SOLID ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, LONGITUDINAL_DISPERSIVITY ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, TRANSVERSE_DISPERSIVITY ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, SOLID_COMPRESSIBILITY ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, DT_TEMPERATURE_COEFFICIENT ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, DT_TEMPERATURE ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, NORMAL_HEAT_FLUX ) + KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, MINIMUM_JOINT_WIDTH ) KRATOS_DEFINE_APPLICATION_VARIABLE( GEO_MECHANICS_APPLICATION, double, TRANSVERSAL_PERMEABILITY ) KRATOS_DEFINE_3D_APPLICATION_VARIABLE_WITH_COMPONENTS( GEO_MECHANICS_APPLICATION, FLUID_FLUX_VECTOR ) diff --git a/applications/GeoMechanicsApplication/tests/cpp_tests/test_geo_mechanics_application.cpp b/applications/GeoMechanicsApplication/tests/cpp_tests/test_geo_mechanics_application.cpp new file mode 100644 index 000000000000..c387537ff8d9 --- /dev/null +++ b/applications/GeoMechanicsApplication/tests/cpp_tests/test_geo_mechanics_application.cpp @@ -0,0 +1,48 @@ +// KRATOS___ +// // ) ) +// // ___ ___ +// // ____ //___) ) // ) ) +// // / / // // / / +// ((____/ / ((____ ((___/ / MECHANICS +// +// License: geo_mechanics_application/license.txt +// +// Main authors: Anne van de Graaf +// + +#include "testing/testing.h" +#include "geo_mechanics_application.h" + +namespace Kratos::Testing +{ + +KRATOS_TEST_CASE_IN_SUITE(ThermalAnalysisVariablesExistAfterRegistration, KratosGeoMechanicsFastSuite) +{ + KratosGeoMechanicsApplication geo_app; + + // Note that when this unit test is run through Python, the variables have already been registered. Therefore, + // checking whether the thermal variables don't exist prior to registration will fail. Presumably after migrating to + // GoogleTest, we can add those checks here as well, to test the effect of `Register()`. + geo_app.Register(); + + const auto variable_names = std::vector{"SPECIFIC_HEAT_CAPACITY_WATER", + "SPECIFIC_HEAT_CAPACITY_SOLID", + "THERMAL_CONDUCTIVITY_WATER", + "THERMAL_CONDUCTIVITY_SOLID_XX", + "THERMAL_CONDUCTIVITY_SOLID_YY", + "THERMAL_CONDUCTIVITY_SOLID_ZZ", + "THERMAL_CONDUCTIVITY_SOLID_XY", + "THERMAL_CONDUCTIVITY_SOLID_YZ", + "THERMAL_CONDUCTIVITY_SOLID_XZ", + "LONGITUDINAL_DISPERSIVITY", + "TRANSVERSE_DISPERSIVITY", + "SOLID_COMPRESSIBILITY", + "DT_TEMPERATURE_COEFFICIENT", + "DT_TEMPERATURE", + "NORMAL_HEAT_FLUX"}; + for (const auto& name : variable_names) { + KRATOS_EXPECT_TRUE(KratosComponents::Has(name)) + } +} + +}