From b230b9984d64c86703b926aba6f21df462f3f4ee Mon Sep 17 00:00:00 2001 From: "jakob.schratter" Date: Tue, 27 Jan 2026 17:55:41 +0100 Subject: [PATCH] own solver --- solid-cpp/ownSolver.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/solid-cpp/ownSolver.cpp b/solid-cpp/ownSolver.cpp index e10b2c2..679a0d1 100644 --- a/solid-cpp/ownSolver.cpp +++ b/solid-cpp/ownSolver.cpp @@ -134,8 +134,10 @@ int main(int argc, char **argv ) participantSolid.setMeshVertices(meshName, coords, vertexIDs); // ----- initialize read- and write-data - std::vector temperature(numberOfVertices * meshDim); // read-data - std::vector heatFlux(numberOfVertices * meshDim); // write-data + //std::vector temperature(numberOfVertices * meshDim); // read-data + //std::vector heatFlux(numberOfVertices * meshDim); // write-data + std::vector temperature(numberOfVertices); // read-data + std::vector heatFlux(numberOfVertices); // write-data double solverDt = 1.0; // solver time step size @@ -159,10 +161,11 @@ int main(int argc, char **argv ) // ----- read temperature computed by openFOAM simulation ----- participantSolid.readData("Solid-Mesh", "Temperature", vertexIDs, dt, temperature); + for (int i = 0; i < numberOfVertices; ++i) { - // TODO: SET THE MESH TO THE INCOMING TEMPERATURE - // "initNewTemp(temperature)" - } + int nodeIndex = wetNodes[i]; + uv[nodeIndex] = temperature[i]; + } // ----- solve time step ----- vector G(Mdt.Nrows(), 0.0); @@ -186,10 +189,14 @@ int main(int argc, char **argv ) 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)" + for (int i = 0; i < numberOfVertices; ++i) { - // TODO: COMPUTE THE HEAT-FLUX FROM THE NEW uv TEMPERATURE SOLUTION - // "computeHeatFlux(heatFlux)" - } + heatFlux[i] = 300.0; + } + + participantSolid.writeData("Solid-Mesh", "Heat-Flux", vertexIDs, heatFlux); // ----- advance preCICE -----