own solver

This commit is contained in:
jakob.schratter 2026-01-27 17:55:41 +01:00
commit b230b9984d

View file

@ -134,8 +134,10 @@ int main(int argc, char **argv )
participantSolid.setMeshVertices(meshName, coords, vertexIDs); participantSolid.setMeshVertices(meshName, coords, vertexIDs);
// ----- initialize read- and write-data // ----- initialize read- and write-data
std::vector<double> temperature(numberOfVertices * meshDim); // read-data //std::vector<double> temperature(numberOfVertices * meshDim); // read-data
std::vector<double> heatFlux(numberOfVertices * meshDim); // write-data //std::vector<double> heatFlux(numberOfVertices * meshDim); // write-data
std::vector<double> temperature(numberOfVertices); // read-data
std::vector<double> heatFlux(numberOfVertices); // write-data
double solverDt = 1.0; // solver time step size double solverDt = 1.0; // solver time step size
@ -159,10 +161,11 @@ int main(int argc, char **argv )
// ----- read temperature computed by openFOAM simulation ----- // ----- read temperature computed by openFOAM simulation -----
participantSolid.readData("Solid-Mesh", "Temperature", vertexIDs, dt, temperature); participantSolid.readData("Solid-Mesh", "Temperature", vertexIDs, dt, temperature);
for (int i = 0; i < numberOfVertices; ++i)
{ {
// TODO: SET THE MESH TO THE INCOMING TEMPERATURE int nodeIndex = wetNodes[i];
// "initNewTemp(temperature)" uv[nodeIndex] = temperature[i];
} }
// ----- solve time step ----- // ----- solve time step -----
vector<double> G(Mdt.Nrows(), 0.0); vector<double> G(Mdt.Nrows(), 0.0);
@ -186,10 +189,14 @@ int main(int argc, char **argv )
time_count += dt; time_count += dt;
// ----- write the heat-flux, so openFOAM can read it // ----- 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 heatFlux[i] = 300.0;
// "computeHeatFlux(heatFlux)" }
}
participantSolid.writeData("Solid-Mesh", "Heat-Flux", vertexIDs, heatFlux); participantSolid.writeData("Solid-Mesh", "Heat-Flux", vertexIDs, heatFlux);
// ----- advance preCICE ----- // ----- advance preCICE -----