Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PfemFluid] Add thermal coupling files #6511

Merged
merged 27 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c39e457
Add 'interval' parameter
djvicente Feb 24, 2020
5dcd03c
Remove check .HasTable from solid and fluid base class
MZecchetto Mar 3, 2020
dce06d9
Add 2D Bingham temperature dependent law
MZecchetto Mar 4, 2020
89e33c2
Add 3D Bingham temperature dependent law
MZecchetto Mar 4, 2020
928db9c
Add 2D Newtonian temperature dependent law
MZecchetto Mar 4, 2020
881ed2f
Add 3D Newtonian temperature dependent law
MZecchetto Mar 4, 2020
656d1dc
Add 2D Hypoelastic temperature dependent law
MZecchetto Mar 4, 2020
1aa66d8
Add 3D Hypoelastic temperature dependent law
MZecchetto Mar 4, 2020
dc8c11c
Add new claws to CMakeLists
MZecchetto Mar 4, 2020
defb69c
Add new claws to pfem_fluid_dynamics_application.h
MZecchetto Mar 4, 2020
9fa1476
Add new claws to pfem_fluid_dynamics_application.cpp
MZecchetto Mar 4, 2020
62e7f10
Add set_mesh_velocity process
MZecchetto Mar 4, 2020
1885cd9
Add new processes to python
MZecchetto Mar 4, 2020
78e6a45
Update solver_wrapper
MZecchetto Mar 4, 2020
af95f67
Add coupled solver
MZecchetto Mar 4, 2020
632d8ed
Add rebuild_thermal_model_part process
MZecchetto Mar 4, 2020
77010be
Add preliminary test
MZecchetto Mar 4, 2020
acf791d
Update NightTest
MZecchetto Mar 4, 2020
4326b7c
Revert "Add 'interval' parameter"
djvicente Feb 24, 2020
3db8d69
Addressing codacy suggestions (I)
MZecchetto Mar 4, 2020
7550e2c
Addressing codacy suggestions (II)
MZecchetto Mar 4, 2020
c648b0a
Addressing codacy suggestions (III)
MZecchetto Mar 4, 2020
361c35a
Merge branch 'master' into PfemFluid/add-thermal-coupling
MZecchetto Mar 18, 2020
324da94
Merge branch 'master' into PfemFluid/add-thermal-coupling
MZecchetto Mar 18, 2020
bb428a3
Merge branch 'master' into PfemFluid/add-thermal-coupling
MZecchetto May 4, 2020
ca050f8
Update thermal test after #6722
MZecchetto May 4, 2020
a31e146
Update thermal test to avoid warning
MZecchetto May 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class ApplyComponentTableProcessDam : public Process
"variable_name": "PLEASE_PRESCRIBE_VARIABLE_NAME",
"is_fixed": false,
"value" : 1.0,
"table" : 1
"table" : 1,
"interval":[
0.0,
0.0
]
} )" );

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ class DamAddedMassConditionProcess : public Process
"Gravity_Direction" : "Y",
"Reservoir_Bottom_Coordinate_in_Gravity_Direction" : 0.0,
"Spe_weight" : 0.0,
"Water_level" : 0.0
"Water_level" : 0.0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class DamAzenhaHeatFluxProcess : public Process
"A" : 0.0,
"B" : 0.0,
"C" : 0.0,
"D" : 0.0
"D" : 0.0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ class DamBofangConditionTemperatureProcess : public Process
"Water_level" : 0.0,
"Water_level_Table" : 0,
"Month" : 1.0,
"Month_Table" : 0
"Month_Table" : 0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ class DamChemoMechanicalAgingYoungProcess : public Process
"max_chemical_porosity" : 0.32,
"chemical_characteristic_aging_time" : 100.0,
"max_mechanical_damage" : 0.32,
"damage_characteristic_aging_time" : 100.0
"damage_characteristic_aging_time" : 100.0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class DamFixTemperatureConditionProcess : public Process
"variable_name" : "PLEASE_PRESCRIBE_VARIABLE_NAME",
"is_fixed" : false,
"value" : 0.0,
"table" : 0
"table" : 0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ class DamGroutingReferenceTemperatureProcess : public Process
"model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME",
"variable_name" : "PLEASE_PRESCRIBE_VARIABLE_NAME",
"initial_value" : 0.0,
"time_grouting" : 0.0
"time_grouting" : 0.0,
"interval":[
0.0,
0.0
]
} )" );

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class DamHydroConditionLoadProcess : public Process
"Reservoir_Bottom_Coordinate_in_Gravity_Direction" : 0.0,
"Spe_weight" : 0.0,
"Water_level" : 0.0,
"Water_Table" : 0
"Water_Table" : 0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class DamNodalReferenceTemperatureProcess : public Process
"model_part_name":"PLEASE_CHOOSE_MODEL_PART_NAME",
"variable_name" : "PLEASE_PRESCRIBE_VARIABLE_NAME",
"initial_value" : 0.0,
"input_file_name" : ""
"input_file_name" : "",
"interval":[
0.0,
0.0
]
} )" );

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class DamNodalYoungModulusProcess : public Process
"Young_Modulus_1" : 10.0,
"Young_Modulus_2" : 60.0,
"Young_Modulus_3" : 50.0,
"Young_Modulus_4" : 70.0
"Young_Modulus_4" : 70.0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class DamNoorzaiHeatFluxProcess : public Process
"density" : 0.0,
"specific_heat" : 0.0,
"t_max" : 0.0,
"alpha" : 0.0
"alpha" : 0.0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ class DamReservoirConstantTemperatureProcess : public Process
"Water_temp" : 0.0,
"Water_temp_Table" : 0,
"Water_level" : 0.0,
"Water_level_Table" : 0
"Water_level_Table" : 0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ class DamReservoirMonitoringTemperatureProcess : public Process
"Water_temp_Table_2" : 0,
"Z_Coord_3" : 0.0,
"Water_temp_3" : 0.0,
"Water_temp_Table_3" : 0
"Water_temp_Table_3" : 0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ class DamTSolAirHeatFluxProcess : public Process
"emisivity" : 0.0,
"delta_R" : 0.0,
"absorption_index" : 0.0,
"total_insolation" : 0.0
"total_insolation" : 0.0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ class DamTemperaturebyDeviceProcess : public Process
"is_fixed" : false,
"value" : 0.0,
"table" : 0,
"position" : [0.0,0.0,0.0]
"position" : [0.0,0.0,0.0],
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ class DamUpliftCircularConditionLoadProcess : public Process
"Height_drain" : 0.0,
"Distance" : 0.0,
"Effectiveness" : 0.0,
"table" : 0
"table" : 0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ class DamUpliftConditionLoadProcess : public Process
"Drains" : false,
"Height_drain" : 0.0,
"Distance" : 0.0,
"Effectiveness" : 0.0
"Effectiveness" : 0.0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ class DamWestergaardConditionLoadProcess : public Process
"Water_level" : 0.0,
"Water_Table" : 0,
"Aceleration" : 0.0,
"Aceleration_Table" : 0
"Aceleration_Table" : 0,
"interval":[
0.0,
0.0
]
} )");

// Some values need to be mandatorily prescribed since no meaningful default value exist. For this reason try accessing to them
Expand Down
6 changes: 6 additions & 0 deletions applications/PfemFluidDynamicsApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ set( KRATOS_PFEM_FLUID_DYNAMICS_APPLICATION_CORE
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/fluid_constitutive_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/bingham_2D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/bingham_3D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/bingham_temperature_dependent_2D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/bingham_temperature_dependent_3D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/newtonian_2D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/newtonian_3D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/newtonian_temperature_dependent_2D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/newtonian_temperature_dependent_3D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/papanastasiou_mu_I_rheology_2D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/papanastasiou_mu_I_rheology_3D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/fluid_laws/barker_mu_I_rheology_3D_law.cpp
Expand All @@ -56,6 +60,8 @@ set( KRATOS_PFEM_FLUID_DYNAMICS_APPLICATION_CORE
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/solid_laws/solid_constitutive_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/solid_laws/hypoelastic_2D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/solid_laws/hypoelastic_3D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/solid_laws/hypoelastic_temperature_dependent_2D_law.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/solid_laws/hypoelastic_temperature_dependent_3D_law.cpp
)

set( KRATOS_PFEM_FLUID_DYNAMICS_APPLICATION_PYTHON_INTERFACE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
//-------------------------------------------------------------
// ___ __ ___ _ _ _
// KRATOS| _ \/ _|___ _ __ | __| |_ _(_)__| |
// | _/ _/ -_) ' \| _|| | || | / _` |
// |_| |_| \___|_|_|_|_| |_|\_,_|_\__,_|DYNAMICS
//
// BSD License: PfemFluidDynamicsApplication/license.txt
//
// Main authors: Massimiliano Zecchetto
// Collaborators:
//
//-------------------------------------------------------------
//

// System includes
#include <iostream>

// External includes
#include <cmath>

// Project includes
#include "custom_constitutive/fluid_laws/bingham_temperature_dependent_2D_law.h"
#include "includes/checks.h"
#include "includes/properties.h"
#include "pfem_fluid_dynamics_application_variables.h"

namespace Kratos {

//********************************CONSTRUCTOR*********************************
//****************************************************************************

BinghamTemperatureDependent2DLaw::BinghamTemperatureDependent2DLaw() : Bingham2DLaw() {}

//******************************COPY CONSTRUCTOR******************************
//****************************************************************************

BinghamTemperatureDependent2DLaw::BinghamTemperatureDependent2DLaw(const BinghamTemperatureDependent2DLaw& rOther) : Bingham2DLaw(rOther) {}

//***********************************CLONE************************************
//****************************************************************************

ConstitutiveLaw::Pointer BinghamTemperatureDependent2DLaw::Clone() const { return Kratos::make_shared<BinghamTemperatureDependent2DLaw>(*this); }

//*********************************DESTRUCTOR*********************************
//****************************************************************************

BinghamTemperatureDependent2DLaw::~BinghamTemperatureDependent2DLaw() {}

std::string BinghamTemperatureDependent2DLaw::Info() const { return "BinghamTemperatureDependent2DLaw"; }

//******************CHECK CONSISTENCY IN THE CONSTITUTIVE LAW******************
//*****************************************************************************

int BinghamTemperatureDependent2DLaw::Check(const Properties& rMaterialProperties, const GeometryType& rElementGeometry,
const ProcessInfo& rCurrentProcessInfo) {

KRATOS_CHECK_VARIABLE_KEY(DYNAMIC_VISCOSITY);
KRATOS_CHECK_VARIABLE_KEY(YIELD_SHEAR);
KRATOS_CHECK_VARIABLE_KEY(ADAPTIVE_EXPONENT);
KRATOS_CHECK_VARIABLE_KEY(BULK_MODULUS);

if (rMaterialProperties[DYNAMIC_VISCOSITY] <= 0.0) {
KRATOS_ERROR << "Incorrect or missing DYNAMIC_VISCOSITY provided in process info for BinghamTemperatureDependent2DLaw: "
<< rMaterialProperties[DYNAMIC_VISCOSITY] << std::endl;
}

if (rMaterialProperties[YIELD_SHEAR] <= 0.0) {
KRATOS_ERROR << "Incorrect or missing YIELD_SHEAR provided in process info for BinghamTemperatureDependent2DLaw: "
<< rMaterialProperties[YIELD_SHEAR] << std::endl;
}

if (rMaterialProperties[ADAPTIVE_EXPONENT] <= 0.0) {
KRATOS_ERROR << "Incorrect or missing ADAPTIVE_EXPONENT provided in process info for BinghamTemperatureDependent2DLaw: "
<< rMaterialProperties[ADAPTIVE_EXPONENT] << std::endl;
}

if (rMaterialProperties[BULK_MODULUS] <= 0.0) {
KRATOS_ERROR << "Incorrect or missing BULK_MODULUS provided in process info for BinghamTemperatureDependent2DLaw: "
<< rMaterialProperties[BULK_MODULUS] << std::endl;
}

return 0;
}

double BinghamTemperatureDependent2DLaw::GetEffectiveViscosity(ConstitutiveLaw::Parameters& rParameters) const {
return rParameters.GetConstitutiveMatrix()(2, 2);
}

double BinghamTemperatureDependent2DLaw::GetEffectiveDensity(ConstitutiveLaw::Parameters& rParameters) const {
const Properties& r_properties = rParameters.GetMaterialProperties();
double effective_density;
if (r_properties.HasTable(TEMPERATURE, DENSITY)) {
effective_density = this->GetValueFromTable(TEMPERATURE, DENSITY, rParameters);
} else {
effective_density = r_properties[DENSITY];
}
return effective_density;
}

double BinghamTemperatureDependent2DLaw::GetEffectiveDynamicViscosity(ConstitutiveLaw::Parameters& rParameters) const {
const Properties& r_properties = rParameters.GetMaterialProperties();
double effective_viscosity;
if (r_properties.HasTable(TEMPERATURE, DYNAMIC_VISCOSITY)) {
effective_viscosity = this->GetValueFromTable(TEMPERATURE, DYNAMIC_VISCOSITY, rParameters);
} else {
effective_viscosity = r_properties[DYNAMIC_VISCOSITY];
}
return effective_viscosity;
}

double BinghamTemperatureDependent2DLaw::GetEffectiveYieldShear(ConstitutiveLaw::Parameters& rParameters) const {
const Properties& r_properties = rParameters.GetMaterialProperties();
double effective_yield_shear;
if (r_properties.HasTable(TEMPERATURE, YIELD_SHEAR)) {
effective_yield_shear = this->GetValueFromTable(TEMPERATURE, YIELD_SHEAR, rParameters);
} else {
effective_yield_shear = r_properties[YIELD_SHEAR];
}
return effective_yield_shear;
}

void BinghamTemperatureDependent2DLaw::save(Serializer& rSerializer) const {
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, Bingham2DLaw)
}

void BinghamTemperatureDependent2DLaw::load(Serializer& rSerializer) {
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, Bingham2DLaw)
}

} // Namespace Kratos
Loading