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);
// ----- initialize read- and write-data
std::vector<double> temperature(numberOfVertices * meshDim); // read-data
std::vector<double> heatFlux(numberOfVertices * meshDim); // write-data
//std::vector<double> temperature(numberOfVertices * meshDim); // read-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
@ -159,9 +161,10 @@ 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 -----
@ -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 -----