convert mesh to meters, more coefficients
This commit is contained in:
parent
6039802b9f
commit
2c4e8ea79c
8 changed files with 33016 additions and 32624 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -350,8 +350,12 @@ class FEM_Matrix: public CRS_Matrix
|
|||
*/
|
||||
void CalculateLaplaceMult(std::vector<double> &f);
|
||||
|
||||
double Thermal_coefficient(const int subdomain);
|
||||
// Returns thermal conductivity coefficient of subdomain [ kg * m / (s^3 * K) ]
|
||||
double ThermalConductivity(const int subdomain);
|
||||
|
||||
// Returns volumetric heap capacity (specific heat capacity * density) coefficient of subdomain
|
||||
// c * rho [ J / (m^3 * K) ]
|
||||
double VolumetricHeatCapacity(const int subdomain);
|
||||
|
||||
/**
|
||||
* Calculates the entries of f.e. stiffness matrix for the Laplace operator
|
||||
|
|
|
|||
34684
mgrid_2/uv.txt
34684
mgrid_2/uv.txt
File diff suppressed because it is too large
Load diff
|
|
@ -18,7 +18,7 @@ fname = 'uv.txt';
|
|||
%h = trisurf(ia, xc(:,1), xc(:,2), v);
|
||||
|
||||
figure;
|
||||
patch('Faces', ia, 'Vertices', xc, 'FaceVertexCData', v, ...
|
||||
h = patch('Faces', ia, 'Vertices', xc, 'FaceVertexCData', v, ...
|
||||
'FaceColor', 'interp', 'EdgeColor', 'k');
|
||||
axis equal tight;
|
||||
colorbar;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue