Hi, everyone
Recently, I tried to writing velocities from CalculiX to another solver. I carried 2D simulation, the Segmentation fault appear after the adapter writing coupling data, as follow:
However, this error won’t appear in 3D simulation, and this situation is the same with this link :
Hello everyone, I have been trying to modify the perpendicular-flap tutorial where I want to write both displacement and velocity from Calculix to OpenFoam. For that, i changed the boundary condition of U from movingWallVelocity to fixedValue. I configured preciceDict file to read velocity by adding FF module along with FSI module as discussed in https://precice.discourse.group/t/about-passing-velocity-to-the-fluid-solver/1362 . Similarly, I configured config.yml files to write velocity too.
I t…
So I want to know if this problem has been solved.
Thank you!
I find out that this may be due to the incomplete coding of writing quasi 2D3D data of velocities.
In PreciceInterface.c
case DISPLACEMENTDELTAS:
if (isQuasi2D3D(interfaces[i]->quasi2D3D)) {
getNodeDisplacementDeltas(interfaces[i]->nodeIDs, interfaces[i]->numNodes, interfaces[i]->dimCCX, sim->vold, sim->coupling_init_v, sim->mt, interfaces[i]->mappingQuasi2D3D->bufferVector3D);
consistentVectorWrite(interfaces[i]->mappingQuasi2D3D, interfaces[i]->couplingMeshName, interfaces[i]->displacementDeltas);
} else {
getNodeDisplacementDeltas(interfaces[i]->nodeIDs, interfaces[i]->numNodes, interfaces[i]->dimCCX, sim->vold, sim->coupling_init_v, sim->mt, interfaces[i]->nodeVectorData);
precicec_writeData(interfaces[i]->couplingMeshName, interfaces[i]->displacementDeltas, interfaces[i]->numNodes, interfaces[i]->preciceNodeIDs, interfaces[i]->nodeVectorData);
}
printf("Writing DISPLACEMENTDELTAS coupling data.\n");
break;
case VELOCITIES:
getNodeVelocities(interfaces[i]->nodeIDs, interfaces[i]->numNodes, interfaces[i]->dim, sim->veold, sim->mt, interfaces[i]->nodeVectorData);
precicec_writeData(interfaces[i]->couplingMeshName, interfaces[i]->velocities, interfaces[i]->numNodes, interfaces[i]->preciceNodeIDs, interfaces[i]->nodeVectorData);
printf("Writing VELOCITIES coupling data.\n");
break;
I add some codes in PreciceInterface.c
. I am not a expert of calculix adapter, so I’m not sure if I coding it right. From the simulation now, it seems ok. If anyone is familiar with this, please check it.
case VELOCITIES:
if (isQuasi2D3D(interfaces[i]->quasi2D3D)) {
getNodeVelocities(interfaces[i]->nodeIDs, interfaces[i]->numNodes, interfaces[i]->dimCCX, sim->veold, sim->mt, interfaces[i]->mappingQuasi2D3D->bufferVector3D);
consistentVectorWrite(interfaces[i]->mappingQuasi2D3D, interfaces[i]->couplingMeshName, interfaces[i]->velocities);
} else {
getNodeVelocities(interfaces[i]->nodeIDs, interfaces[i]->numNodes, interfaces[i]->dim, sim->veold, sim->mt, interfaces[i]->nodeVectorData);
precicec_writeData(interfaces[i]->couplingMeshName, interfaces[i]->velocities, interfaces[i]->numNodes, interfaces[i]->preciceNodeIDs, interfaces[i]->nodeVectorData);
}
printf("Writing VELOCITIES coupling data.\n");
break;
Thank you~