CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Co-Simulation API Coupling Volume to Volume (https://www.cfd-online.com/Forums/star-ccm/216629-co-simulation-api-coupling-volume-volume.html)

fais94 April 14, 2019 13:03

Co-Simulation API Coupling Volume to Volume
 
Hello guys,
I ask for your to solve this problem. I am working on a project using the Co-Simulation API, I am trying to to couple a region (volume to volume), I have followed the manual, and I have added all the properties to the function "fillContainerHandler". When i run the code I have the following error "Error: ERROR: Number of region boundaries:0 does not match NumberOfBoundaries:1." when the code runs this API function "apiSuite->notifyOutgoingMeshReady(meshId);".
I would like to ask which is the parameter that affect the number of region boundaries.

I will wait for your reply. Sincerely,

Faissal

PS. I attach you the function "fillContainerHandler"
void fillContainerHandler(int containerIndex, char const* requirement)
{
if (containerIndex == meshId)
{
std::cout << "- Filling surface mesh container " << containerIndex << std::endl;

propertiesSuite->addInteger(containerIndex, "NumberOfDimensions", 3);
propertiesSuite->addInteger(containerIndex, "NumberOfVertices", 44);
propertiesSuite->addInteger(containerIndex, "NumberOfInteriorFaces", 9);
propertiesSuite->addInteger(containerIndex, "NumberOfBoundaryFaces", 42);

propertiesSuite->addDoubleArray(containerIndex,
"Coordinates",
&Coordinates[0],
132);

propertiesSuite->addIntegerArray(containerIndex,
"VertexIds",
&VertexIds[0],
44);
std::cout << "- CHECK POINT 1 " << std::endl;
/*
* The following is only coded for the one boundary
*
* Note the addition of the:
* addStringELement
* addIntegerarrayElement
* addDoubleArrayELement
* calls to the property container suite.
*
* This allows you to add multiple:
* strings
* integer arrays
* double arrays
* under a specific property name.
* (i.e. just like the standard library push_back functions.
*/

int const NUM_BOUNDARIES = 1;
propertiesSuite->addInteger(containerIndex, "NumberOfBoundaryRegions", 1);
propertiesSuite->addInteger(containerIndex, "NumberOfBoundaries", NUM_BOUNDARIES);

std::cout << "- CHECK POINT 2 " << std::endl;
/*
* If you had more than one boundary then you would put the loop here after
* the numBoundaryFaces vector declaration.
*
* For each boundary:
* 1: Add the number of boundary faces into the numBoundaryFaces vector.
* 2: Add the boundary name to the "BoundaryNames" property array.
* 3: Add the boundary face vertex list array to the "BoundaryFaceVertexList" property array.
*
* Once the loop has finished:
* 4: Set the "NumberOfBoundaryFaces" array property.
*/

//std::vector<unsigned int> numBoundaryFaces;

// 1: set the number of faces for this boundary

// 2: add the boundary name for this boundary
propertiesSuite->addStringElement(containerIndex, "BoundaryNames","Heat Generation Volume");
propertiesSuite->addStringElement(containerIndex, "RegionNames", "Heat Generation Volume");
//////////////////////////////////////////////////////////////////////////////////////////////
propertiesSuite->addIntegerArray(containerIndex,
"InteriorFaceCellIndexList",
&InteriorFaceCellIndexList[0],
10);

propertiesSuite->addIntegerArray(containerIndex,
"InteriorFaceVertexList",
&InteriorFaceVertexList[0],
45);
propertiesSuite->addIntegerArrayReference(containerIndex,
"BoundaryFaceCellIndexList",
&BoundaryFaceCellIndexList[0],
84);

std::cout << "- CHECK POINT 3 " << std::endl;
////////////////////////////////////////////////////////////////////////////////////////////////
// 3: add the face vertex list for this boundary
propertiesSuite->addIntegerArrayReference(containerIndex,
"BoundaryFaceVertexList",
&BoundaryFaceVertexList[0],
152);







// 4: send array of number of boundary faces
propertiesSuite->addIntegerArray(containerIndex,
"NumberOfBoundaryFaces",
&numBoundaryFaces[0],
NUM_BOUNDARIES);





std::cout << "- CHECK POINT 4 " << std::endl;
}
else if (containerIndex == QgenId)
{
std::cout
<< "Qgen_solid: Filling Qgenlacement container "
<< containerIndex
<< " requirement:""
<< requirement
<< "" size "
// << vvf.getFieldSize()
<< std::endl;

// FieldValues arrays must be in boundary creation order.
propertiesSuite->addDoubleArrayElement(containerIndex,
"FieldValues",
&Qgen[0],
10);
}
else
{
std::cout
<< "Qgen_solid: Unknown container: "
<< containerIndex
<< " req:""
<< requirement
<< """
<< std::endl;
}
}


All times are GMT -4. The time now is 09:33.