own solver
This commit is contained in:
parent
5a44a2b804
commit
b230b9984d
1 changed files with 15 additions and 8 deletions
|
|
@ -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 -----
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue