-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GeoMechanicsApplication] Add point heat flux (source) condition for …
…heat (#12340) * Added flux point condition for thermal part * deleted thermal files, in order to add them again with small letters This is a trick, because winsows does not see difference in small or capital letters, but the compiliation fails on GCC. Delete them first then add them again with small letters * Added the files again with small letters * Added test cases for 2D and 3D line elements -> 2D and 3D point fluxes * A small fix * Added section area to line element * Fixed test cases which were influenced by adding SECTION_AREA * Modifications based on review requirements * Modifications based on review * Added test documentation * fix in Readme * Removed "SECTION_AREA"from registration * Modification in material parameters * Modification in README.md based on review suggestions * Modifications based on review * fix in README.md * modifications based on review
- Loading branch information
1 parent
8dbd2ec
commit 44468d2
Showing
23 changed files
with
1,701 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
applications/GeoMechanicsApplication/custom_conditions/thermal_point_flux_condition.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// KRATOS___ | ||
// // ) ) | ||
// // ___ ___ | ||
// // ____ //___) ) // ) ) | ||
// // / / // // / / | ||
// ((____/ / ((____ ((___/ / MECHANICS | ||
// | ||
// License: geo_mechanics_application/license.txt | ||
// | ||
// | ||
// Main authors: Mohamed Nabi | ||
// John van Esch | ||
// | ||
|
||
#include "custom_conditions/thermal_point_flux_condition.h" | ||
|
||
namespace Kratos | ||
{ | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
GeoThermalPointFluxCondition<TDim, TNumNodes>::GeoThermalPointFluxCondition() | ||
: GeoTCondition<TDim, TNumNodes>() | ||
{ | ||
} | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
GeoThermalPointFluxCondition<TDim, TNumNodes>::GeoThermalPointFluxCondition(IndexType NewId, | ||
GeometryType::Pointer pGeometry) | ||
: GeoTCondition<TDim, TNumNodes>(NewId, pGeometry) | ||
{ | ||
} | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
GeoThermalPointFluxCondition<TDim, TNumNodes>::GeoThermalPointFluxCondition(IndexType NewId, | ||
GeometryType::Pointer pGeometry, | ||
PropertiesType::Pointer pProperties) | ||
: GeoTCondition<TDim, TNumNodes>(NewId, pGeometry, pProperties) | ||
{ | ||
} | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
void GeoThermalPointFluxCondition<TDim, TNumNodes>::CalculateRHS(Vector& rRightHandSideVector, const ProcessInfo&) | ||
{ | ||
rRightHandSideVector[0] = this->GetGeometry()[0].FastGetSolutionStepValue(NORMAL_HEAT_FLUX); | ||
} | ||
|
||
template class GeoThermalPointFluxCondition<2, 1>; | ||
template class GeoThermalPointFluxCondition<3, 1>; | ||
|
||
} // namespace Kratos |
64 changes: 64 additions & 0 deletions
64
applications/GeoMechanicsApplication/custom_conditions/thermal_point_flux_condition.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// KRATOS___ | ||
// // ) ) | ||
// // ___ ___ | ||
// // ____ //___) ) // ) ) | ||
// // / / // // / / | ||
// ((____/ / ((____ ((___/ / MECHANICS | ||
// | ||
// License: geo_mechanics_application/license.txt | ||
// | ||
// | ||
// Main authors: Mohamed Nabi | ||
// John van Esch | ||
// | ||
|
||
#pragma once | ||
|
||
#include "custom_conditions/T_condition.h" | ||
#include "includes/serializer.h" | ||
|
||
namespace Kratos | ||
{ | ||
|
||
template <unsigned int TDim, unsigned int TNumNodes> | ||
class KRATOS_API(GEO_MECHANICS_APPLICATION) GeoThermalPointFluxCondition | ||
: public GeoTCondition<TDim, TNumNodes> | ||
{ | ||
public: | ||
using GeometryType = Geometry<Node>; | ||
using PropertiesType = Properties; | ||
using NodesArrayType = GeometryType::PointsArrayType; | ||
using BaseType = GeoTCondition<TDim, TNumNodes>; | ||
|
||
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(GeoThermalPointFluxCondition); | ||
|
||
GeoThermalPointFluxCondition(); | ||
|
||
GeoThermalPointFluxCondition(IndexType NewId, GeometryType::Pointer pGeometry); | ||
|
||
GeoThermalPointFluxCondition(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties); | ||
|
||
Condition::Pointer Create(IndexType NewId, const NodesArrayType& rThisNodes, PropertiesType::Pointer pProperties) const override | ||
{ | ||
return Kratos::make_intrusive<GeoThermalPointFluxCondition>( | ||
NewId, this->GetGeometry().Create(rThisNodes), pProperties); | ||
} | ||
|
||
protected: | ||
void CalculateRHS(Vector& rRightHandSideVector, const ProcessInfo& CurrentProcessInfo) override; | ||
|
||
private: | ||
friend class Serializer; | ||
|
||
void save(Serializer& rSerializer) const override | ||
{ | ||
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, BaseType) | ||
} | ||
|
||
void load(Serializer& rSerializer) override | ||
{ | ||
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, BaseType) | ||
} | ||
}; | ||
|
||
} // namespace Kratos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...s/test_thermal_element/documentation_data/test_thermal_point_flux_condition.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+61.8 KB
...al_element/documentation_data/test_thermal_point_flux_condition_2D3N_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
...test_thermal_element/test_thermal_heat_flux_line_element/Common/MaterialParameters2D.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"properties": [{ | ||
"model_part_name": "PorousDomain.Soil", | ||
"properties_id": 1, | ||
"Material": { | ||
"constitutive_law": { | ||
"name" : "GeoThermalDispersion2DLaw" | ||
}, | ||
"Variables": { | ||
"DENSITY_SOLID" : 2650, | ||
"DENSITY_WATER" : 1000, | ||
"POROSITY" : 0.36, | ||
"RETENTION_LAW" : "SaturatedLaw", | ||
"SATURATED_SATURATION" : 1.0, | ||
"SPECIFIC_HEAT_CAPACITY_SOLID" : 400.0, | ||
"SPECIFIC_HEAT_CAPACITY_WATER" : 3795.0, | ||
"THERMAL_CONDUCTIVITY_SOLID_XX" : 1.50, | ||
"THERMAL_CONDUCTIVITY_WATER" : 0.48, | ||
"CROSS_AREA" : 0.3 | ||
}, | ||
"Tables": {} | ||
} | ||
}] | ||
} |
24 changes: 24 additions & 0 deletions
24
...test_thermal_element/test_thermal_heat_flux_line_element/Common/MaterialParameters3D.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"properties": [{ | ||
"model_part_name": "PorousDomain.Soil", | ||
"properties_id": 1, | ||
"Material": { | ||
"constitutive_law": { | ||
"name" : "GeoThermalDispersion3DLaw" | ||
}, | ||
"Variables": { | ||
"DENSITY_SOLID" : 2650, | ||
"DENSITY_WATER" : 1000, | ||
"POROSITY" : 0.36, | ||
"RETENTION_LAW" : "SaturatedLaw", | ||
"SATURATED_SATURATION" : 1.0, | ||
"SPECIFIC_HEAT_CAPACITY_SOLID" : 400.0, | ||
"SPECIFIC_HEAT_CAPACITY_WATER" : 3795.0, | ||
"THERMAL_CONDUCTIVITY_SOLID_XX" : 1.50, | ||
"THERMAL_CONDUCTIVITY_WATER" : 0.48, | ||
"CROSS_AREA" : 0.3 | ||
}, | ||
"Tables": {} | ||
} | ||
}] | ||
} |
30 changes: 30 additions & 0 deletions
30
...cation/tests/test_thermal_element/test_thermal_heat_flux_line_element/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Test Cases for Thermal Point Flux Condition | ||
|
||
**Author:** [Mohamed Nabi](https://github.com/mnabideltares) | ||
|
||
**Source files:** [Thermal line element with point flux condition](https://github.com/KratosMultiphysics/Kratos/tree/master/applications/GeoMechanicsApplication/tests/test_thermal_element/test_thermal_heat_flux_line_element) | ||
|
||
## Case Specification | ||
In this thermal test case, a 1 m high soil column is considered, where the initial temperature in the entire domain is set to 0 $\mathrm{[^\circ C]}$. The top boundary condition is set to be 0 $\mathrm{[^\circ C]}$. A heat flux of 100 $\mathrm{[W/m^2]}$ is set at the bottom boundary. The simulation spans 250 days to allow for a transition from the initial condition to a linear temperature profile between the two sides. This test is conducted for various configurations, including 2D2N, 2D3N, 2D4N, 2D5N, 3D2N and 3D3N line elements. The temperature distribution along the depth is then evaluated with its own result. | ||
The boundary conditions are shown below: | ||
|
||
<img src="../documentation_data/test_thermal_point_flux_condition.svg" alt="Visualization of the Boundary conditions" title="Visualization of the Boundary conditions" width="600"> | ||
|
||
## Results | ||
|
||
The picture below illustrates the temperature distribution resulting from the simulation (as an example the 2D3N test is shown below). | ||
|
||
<img src="../documentation_data/test_thermal_point_flux_condition_2D3N_result.png" alt="Temperature along the depth at the last time step" title="Temperature along the depth at the last time step" width="600"> | ||
|
||
These results are associated with the final time step after the solution reaches a steady state. The analytical solution is: | ||
|
||
$T = \frac{q}{D} \left( 1 - y \right)$ | ||
|
||
where $q$ is flux per cross sectional area and $D$ is the dispersion coefficient. | ||
|
||
$q = \frac{Q}{A} = \frac{30}{0.3} = 100 \mathrm{[W/m^2]}$ and $D = 1.1328 $ | ||
$D = n S \lambda^w + (1-n) \lambda^s = 0.36 \times 1 \times 0.48 + (1-0.36) \times 1.5 = 1.1328 \mathrm{[W/m ^\circ C]}$ | ||
|
||
where, $Q \mathrm{[W]}$ is the total flux, $A \mathrm{[m^2]}$ is the cross section area, $n \mathrm{[-]}$ porosity, $S \mathrm{[-]}$ the saturation, $\lambda^w \mathrm{[W/m ^\circ C]}$ water thermal conductivity and $\lambda^s \mathrm{[W/m ^\circ C]}$ is the soil thermal conductivity. | ||
|
||
In this test case, the result at node number 1 at location the bottom of the column, namely at $y = 0 \mathrm{[m]}$, is compared with the analytical solution. The value of the temperature at node 1 is $\frac{100}{1.1328}$ $\mathrm{[^\circ C]}$ |
139 changes: 139 additions & 0 deletions
139
...t/test_thermal_heat_flux_line_element/test_thermal_point_flux_2D2N/ProjectParameters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
{ | ||
"problem_data": { | ||
"problem_name": "test_thermal_point_flux_2D2N", | ||
"start_time": 0.0, | ||
"end_time": 21600000, | ||
"echo_level": 1, | ||
"parallel_type": "OpenMP", | ||
"number_of_threads": 1 | ||
}, | ||
"solver_settings": { | ||
"solver_type": "T", | ||
"model_part_name": "PorousDomain", | ||
"domain_size": 2, | ||
"model_import_settings": { | ||
"input_type": "mdpa", | ||
"input_filename": "test_thermal_point_flux_2D2N" | ||
}, | ||
"material_import_settings": { | ||
"materials_filename": "../Common/MaterialParameters2D.json" | ||
}, | ||
"time_stepping": { | ||
"time_step": 600, | ||
"max_delta_time_factor": 1000 | ||
}, | ||
"buffer_size": 2, | ||
"echo_level": 1, | ||
"clear_storage": false, | ||
"compute_reactions": false, | ||
"move_mesh_flag": false, | ||
"reform_dofs_at_each_step": false, | ||
"nodal_smoothing": false, | ||
"block_builder": true, | ||
"solution_type": "Transient_Heat_Transfer", | ||
"scheme_type": "Backward_Euler", | ||
"reset_displacements": true, | ||
"newmark_beta": 0.25, | ||
"newmark_gamma": 0.5, | ||
"newmark_theta": 0.5, | ||
"rayleigh_m": 0.0, | ||
"rayleigh_k": 0.0, | ||
"strategy_type": "newton_raphson", | ||
"convergence_criterion": "temperature_criterion", | ||
"temperature_relative_tolerance": 1.0E-4, | ||
"temperature_absolute_tolerance": 1.0E-9, | ||
"residual_relative_tolerance": 1.0E-4, | ||
"residual_absolute_tolerance": 1.0E-9, | ||
"min_iterations": 6, | ||
"max_iterations": 15, | ||
"number_cycles": 100, | ||
"reduction_factor": 0.5, | ||
"increase_factor": 2.0, | ||
"desired_iterations": 4, | ||
"max_radius_factor": 10.0, | ||
"min_radius_factor": 0.1, | ||
"calculate_reactions": true, | ||
"max_line_search_iterations": 5, | ||
"first_alpha_value": 0.5, | ||
"second_alpha_value": 1.0, | ||
"min_alpha": 0.1, | ||
"max_alpha": 2.0, | ||
"line_search_tolerance": 0.5, | ||
"rotation_dofs": true, | ||
"linear_solver_settings": { | ||
"solver_type": "LinearSolversApplication.sparse_lu", | ||
"scaling": true | ||
}, | ||
"problem_domain_sub_model_part_list": ["Soil"], | ||
"processes_sub_model_part_list": ["top","bottom"], | ||
"body_domain_sub_model_part_list": ["Soil"] | ||
}, | ||
"output_processes": { | ||
"gid_output": [{ | ||
"python_module": "gid_output_process", | ||
"kratos_module": "KratosMultiphysics", | ||
"process_name": "GiDOutputProcess", | ||
"Parameters": { | ||
"model_part_name": "PorousDomain.porous_computational_model_part", | ||
"output_name": "test_thermal_point_flux_2D2N", | ||
"postprocess_parameters": { | ||
"result_file_configuration": { | ||
"gidpost_flags": { | ||
"WriteDeformedMeshFlag": "WriteUndeformed", | ||
"WriteConditionsFlag": "WriteElementsOnly", | ||
"GiDPostMode": "GiD_PostAscii", | ||
"MultiFileFlag": "SingleFile" | ||
}, | ||
"file_label": "step", | ||
"output_control_type": "step", | ||
"output_interval": 1, | ||
"body_output": true, | ||
"node_output": false, | ||
"skin_output": false, | ||
"plane_output": [], | ||
"nodal_results": ["TEMPERATURE"], | ||
"gauss_point_results": [] | ||
}, | ||
"point_data_configuration": [] | ||
} | ||
} | ||
}] | ||
}, | ||
"processes": { | ||
"constraints_process_list": [{ | ||
"python_module": "apply_scalar_constraint_table_process", | ||
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication", | ||
"process_name": "ApplyScalarConstraintTableProcess", | ||
"Parameters": { | ||
"model_part_name": "PorousDomain.Soil", | ||
"variable_name": "TEMPERATURE", | ||
"is_fixed": false, | ||
"value": 0.0, | ||
"table": 0 | ||
} | ||
},{ | ||
"python_module": "apply_scalar_constraint_table_process", | ||
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication", | ||
"process_name": "ApplyScalarConstraintTableProcess", | ||
"Parameters": { | ||
"model_part_name": "PorousDomain.top", | ||
"variable_name": "TEMPERATURE", | ||
"is_fixed": true, | ||
"value": 0.0, | ||
"table": 0 | ||
} | ||
}], | ||
"loads_process_list": [{ | ||
"python_module": "apply_scalar_constraint_table_process", | ||
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication", | ||
"process_name": "ApplyScalarConstraintTableProcess", | ||
"Parameters": { | ||
"model_part_name": "PorousDomain.bottom", | ||
"variable_name": "NORMAL_HEAT_FLUX", | ||
"value": 30.0, | ||
"table": 0 | ||
} | ||
}], | ||
"auxiliar_process_list": [] | ||
} | ||
} |
Oops, something went wrong.