tweaked parameters to be more realistic -> coffee cup cools down early (as expected)
This commit is contained in:
parent
2d407097db
commit
5ae5e5ed03
5 changed files with 10742 additions and 10731 deletions
|
|
@ -434,7 +434,8 @@ double FEM_Matrix::ThermalConductivity(const int subdomain)
|
||||||
{
|
{
|
||||||
// ceramic mug
|
// ceramic mug
|
||||||
case 0:
|
case 0:
|
||||||
lambda = 10.0; // anything from 1 to 4
|
//lambda = 5.0;
|
||||||
|
lambda = 30.0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// water
|
// water
|
||||||
|
|
@ -673,16 +674,16 @@ double FEM_Matrix::Heat_transfer_coefficient(const int subdomain)
|
||||||
{
|
{
|
||||||
double alpha = 0.0;
|
double alpha = 0.0;
|
||||||
|
|
||||||
switch (subdomain)
|
switch (subdomain) // radiation!
|
||||||
{
|
{
|
||||||
// ceramic to air
|
// ceramic to air
|
||||||
case 0:
|
case 0:
|
||||||
alpha = 1.0;
|
alpha = 15.0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// air to air (Free Convection Gas - Free Convection Gas : U = 1 - 2 W/m2K (typical window, room to outside air through glass))
|
// air to air (Free Convection Gas - Free Convection Gas : U = 1 - 2 W/m2K (typical window, room to outside air through glass))
|
||||||
case 2:
|
case 2:
|
||||||
alpha = 15.0;
|
alpha = 30.0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ int main(int argc, char **argv )
|
||||||
// ##########################################
|
// ##########################################
|
||||||
|
|
||||||
double dt = 1.0; // time step
|
double dt = 1.0; // time step
|
||||||
int steps = 100; // number of time iterations
|
int max_it = 600; // number of max iterations
|
||||||
|
|
||||||
double u0_mug = 18.0;
|
double u0_mug = 18.0;
|
||||||
double u0_fluid = 80.0;
|
double u0_fluid = 80.0;
|
||||||
|
|
@ -88,9 +88,11 @@ int main(int argc, char **argv )
|
||||||
double goal_temp = 67.0;
|
double goal_temp = 67.0;
|
||||||
double goal_perc = 60.0;
|
double goal_perc = 60.0;
|
||||||
|
|
||||||
|
double prev_temp = u0_mug;
|
||||||
|
|
||||||
double time_count = 0;
|
double time_count = 0;
|
||||||
//while (average_cup_temperature < goal_temp)
|
while (average_cup_temperature < goal_temp && prev_temp <= average_cup_temperature)
|
||||||
while (percentage_temp_reached < goal_perc)
|
//while (percentage_temp_reached < goal_perc)
|
||||||
//for (int step = 0; step < steps; ++step)
|
//for (int step = 0; step < steps; ++step)
|
||||||
{
|
{
|
||||||
vector<double> G(Mdt.Nrows(), 0.0);
|
vector<double> G(Mdt.Nrows(), 0.0);
|
||||||
|
|
@ -105,6 +107,8 @@ int main(int argc, char **argv )
|
||||||
JacobiSolve(SK, H, uv); // solve: (M/dt + K + C) * u_{n+1} = F + M/dt * u_{n}
|
JacobiSolve(SK, H, uv); // solve: (M/dt + K + C) * u_{n+1} = F + M/dt * u_{n}
|
||||||
// ----- SK ----- ------ H -------
|
// ----- SK ----- ------ H -------
|
||||||
|
|
||||||
|
prev_temp = average_cup_temperature;
|
||||||
|
|
||||||
average_cup_temperature = mesh_c.AverageVectorFunction_perSubdomain(uv, 0);
|
average_cup_temperature = mesh_c.AverageVectorFunction_perSubdomain(uv, 0);
|
||||||
percentage_temp_reached = mesh_c.CheckTemp_mult(uv, 0, goal_temp);
|
percentage_temp_reached = mesh_c.CheckTemp_mult(uv, 0, goal_temp);
|
||||||
cout << "Average cup temperature: " << average_cup_temperature << " after " << time_count << " seconds. " << endl;
|
cout << "Average cup temperature: " << average_cup_temperature << " after " << time_count << " seconds. " << endl;
|
||||||
|
|
@ -143,8 +147,9 @@ int main(int argc, char **argv )
|
||||||
percentage_temp_reached = mesh_c.CheckTemp_mult(uv, 1, goal_temp);
|
percentage_temp_reached = mesh_c.CheckTemp_mult(uv, 1, goal_temp);
|
||||||
|
|
||||||
time_count = 0;
|
time_count = 0;
|
||||||
//while (average_coffee_temperature > goal_temp)
|
int step = 0;
|
||||||
while (percentage_temp_reached > goal_perc)
|
while (average_coffee_temperature > goal_temp && step < max_it)
|
||||||
|
//while (percentage_temp_reached > goal_perc)
|
||||||
{
|
{
|
||||||
vector<double> G(Mdt.Nrows(), 0.0);
|
vector<double> G(Mdt.Nrows(), 0.0);
|
||||||
Mdt.Mult(G, uv); // G = M/dt * u_{n}
|
Mdt.Mult(G, uv); // G = M/dt * u_{n}
|
||||||
|
|
@ -163,6 +168,7 @@ int main(int argc, char **argv )
|
||||||
cout << "Average coffee temperature: " << average_coffee_temperature << " after " << time_count << " seconds. " << endl;
|
cout << "Average coffee temperature: " << average_coffee_temperature << " after " << time_count << " seconds. " << endl;
|
||||||
cout << "% of elements above temperature " << goal_temp << "ºC: " << percentage_temp_reached << endl;
|
cout << "% of elements above temperature " << goal_temp << "ºC: " << percentage_temp_reached << endl;
|
||||||
time_count += dt;
|
time_count += dt;
|
||||||
|
++step;
|
||||||
}
|
}
|
||||||
t4 = system_clock::now(); // stop timer
|
t4 = system_clock::now(); // stop timer
|
||||||
|
|
||||||
|
|
|
||||||
10730
mgrid_2/uv.txt
10730
mgrid_2/uv.txt
File diff suppressed because it is too large
Load diff
|
|
@ -42,7 +42,7 @@ int main(int argc, char **argv )
|
||||||
// ##########################################
|
// ##########################################
|
||||||
|
|
||||||
double dt = 1.0; // time step
|
double dt = 1.0; // time step
|
||||||
int steps = 100; // number of time iterations
|
int max_it = 300; // number of time iterations
|
||||||
double u_out = 18.0;
|
double u_out = 18.0;
|
||||||
|
|
||||||
// ##########################################
|
// ##########################################
|
||||||
|
|
@ -157,8 +157,10 @@ int main(int argc, char **argv )
|
||||||
goal_perc = 60.0;
|
goal_perc = 60.0;
|
||||||
|
|
||||||
double time_count = 0;
|
double time_count = 0;
|
||||||
//while (average_coffee_temperature > goal_temp)
|
int step = 0;
|
||||||
while (percentage_temp_reached > goal_perc)
|
while (average_coffee_temperature > goal_temp && step < max_it)
|
||||||
|
//while (percentage_temp_reached > goal_perc)
|
||||||
|
for(int i = 0; i < 100; ++i)
|
||||||
{
|
{
|
||||||
preciceDt = participantSolid.getMaxTimeStepSize();
|
preciceDt = participantSolid.getMaxTimeStepSize();
|
||||||
solverDt = 1.0;
|
solverDt = 1.0;
|
||||||
|
|
@ -199,7 +201,7 @@ int main(int argc, char **argv )
|
||||||
for (int i = 0; i < numberOfVertices; ++i)
|
for (int i = 0; i < numberOfVertices; ++i)
|
||||||
{
|
{
|
||||||
int nodeIndex = wetNodes[i];
|
int nodeIndex = wetNodes[i];
|
||||||
heatFlux[i] = 15.0*(uv[nodeIndex] - 31.0); // alpha is assumed 15.0 regardless of material
|
heatFlux[i] = 30.0*(uv[nodeIndex] - 31.0); // alpha is assumed for air material at the top
|
||||||
}
|
}
|
||||||
participantSolid.writeData("Solid-Mesh", "Heat-Flux", vertexIDs, heatFlux);
|
participantSolid.writeData("Solid-Mesh", "Heat-Flux", vertexIDs, heatFlux);
|
||||||
|
|
||||||
|
|
@ -209,6 +211,7 @@ int main(int argc, char **argv )
|
||||||
|
|
||||||
|
|
||||||
time_count += dt;
|
time_count += dt;
|
||||||
|
++step;
|
||||||
}
|
}
|
||||||
auto t4 = system_clock::now(); // stop timer
|
auto t4 = system_clock::now(); // stop timer
|
||||||
auto duration = duration_cast<microseconds>(t4 - t3); // duration in microseconds
|
auto duration = duration_cast<microseconds>(t4 - t3); // duration in microseconds
|
||||||
|
|
@ -220,6 +223,7 @@ int main(int argc, char **argv )
|
||||||
participantSolid.finalize();
|
participantSolid.finalize();
|
||||||
|
|
||||||
|
|
||||||
|
mesh_c.Visualize(uv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
10728
solid-cpp/uv_1.txt
10728
solid-cpp/uv_1.txt
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue