Skip to content

Commit

Permalink
Define, add, and register variables for thermal analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
avdg81 committed Oct 30, 2023
1 parent 93d76b3 commit 1653403
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
11 changes: 11 additions & 0 deletions applications/GeoMechanicsApplication/geo_mechanics_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
@@ -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<std::string>{"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<VariableData>::Has(name))
}
}

}

0 comments on commit 1653403

Please sign in to comment.