convert mesh to meters, more coefficients

This commit is contained in:
dino.celebic 2026-01-24 00:45:46 +01:00
commit 2c4e8ea79c
8 changed files with 33016 additions and 32624 deletions

View file

@ -410,7 +410,7 @@ void FEM_Matrix::CalculateLaplaceMult(vector<double> &f)
for (int i = 0; i < nelem; ++i) {
auto subdomain = sd_vec[i];
double lambda = Thermal_coefficient(subdomain);
double lambda = ThermalConductivity(subdomain);
cout << subdomain << endl;
@ -429,30 +429,23 @@ void FEM_Matrix::CalculateLaplaceMult(vector<double> &f)
return;
}
double FEM_Matrix::Thermal_coefficient(const int subdomain)
double FEM_Matrix::ThermalConductivity(const int subdomain)
{
int matlab_sd_index = subdomain - 1;
double lambda = 0.0;
switch (matlab_sd_index)
switch (subdomain)
{
// outside
// ceramic mug
case 0:
lambda = 0.026;
break;
// ceramic
case 1:
lambda = 3.0; // anything from 1 to 4
break;
// water
case 2:
case 1:
lambda = 0.6;
break;
// air
case 3:
case 2:
lambda = 0.026; // depends on temperature actually
break;
@ -464,6 +457,33 @@ double FEM_Matrix::Thermal_coefficient(const int subdomain)
return lambda;
}
double FEM_Matrix::VolumetricHeatCapacity(const int subdomain)
{
double lambda = 0.0;
switch (subdomain)
{
// ceramic mug
case 1:
lambda = 2.0 * 1e6;
break;
// water
case 2:
lambda = 4.184 * 1e6;
break;
// air
case 3:
lambda = 1.2 * 1e3;
break;
default:
lambda = 1.0;
break;
}
return lambda;
}
void FEM_Matrix::CalculateLaplace(vector<double> &f)
{