From 6da3ea1f2d98cb761644eeb350691717da1a1d48 Mon Sep 17 00:00:00 2001 From: "jakob.schratter" Date: Tue, 27 Jan 2026 18:36:15 +0100 Subject: [PATCH] as --- mgrid_2/getmatrix.cpp | 4 ++-- solid-cpp/ownSolver.cpp | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mgrid_2/getmatrix.cpp b/mgrid_2/getmatrix.cpp index 9d5378a..b3bb3e3 100644 --- a/mgrid_2/getmatrix.cpp +++ b/mgrid_2/getmatrix.cpp @@ -434,7 +434,7 @@ double FEM_Matrix::ThermalConductivity(const int subdomain) { // ceramic mug case 0: - lambda = 6.0; // anything from 1 to 4 + lambda = 10.0; // anything from 1 to 4 break; // water @@ -682,7 +682,7 @@ double FEM_Matrix::Heat_transfer_coefficient(const int subdomain) // air to air (Free Convection Gas - Free Convection Gas : U = 1 - 2 W/m2K (typical window, room to outside air through glass)) case 2: - alpha = 1.0; + alpha = 15.0; break; default: diff --git a/solid-cpp/ownSolver.cpp b/solid-cpp/ownSolver.cpp index 679a0d1..7ecb5f7 100644 --- a/solid-cpp/ownSolver.cpp +++ b/solid-cpp/ownSolver.cpp @@ -167,6 +167,7 @@ int main(int argc, char **argv ) uv[nodeIndex] = temperature[i]; } + // ----- solve time step ----- vector G(Mdt.Nrows(), 0.0); Mdt.Mult(G, uv); // G = M/dt * u_{n} @@ -188,17 +189,15 @@ int main(int argc, char **argv ) cout << "% of elements above temperature " << goal_temp << "ÂșC: " << percentage_temp_reached << endl; time_count += dt; - // ----- write the heat-flux, so openFOAM can read it - // TODO: COMPUTE THE HEAT-FLUX FROM THE NEW uv TEMPERATURE SOLUTION - // "computeHeatFlux(heatFlux)" + // ----- compute and write the heat-flux, so openFOAM can read it for (int i = 0; i < numberOfVertices; ++i) { - heatFlux[i] = 300.0; + int nodeIndex = wetNodes[i]; + heatFlux[i] = 15.0*(uv[nodeIndex] - 31.0); // alpha is assumed 15.0 regardless of material } - - participantSolid.writeData("Solid-Mesh", "Heat-Flux", vertexIDs, heatFlux); + // ----- advance preCICE ----- participantSolid.advance(dt);