|
[Sponsors] |
April 14, 2019, 13:03 |
Co-Simulation API Coupling Volume to Volume
|
#1 |
New Member
Faissal El Idrissi
Join Date: Dec 2018
Posts: 1
Rep Power: 0 |
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; } } |
|
Tags |
cosimulation api, starccm+ |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
OpenFOAM extended 4.0 Error with Multinode Set-up | Liweix | OpenFOAM Running, Solving & CFD | 1 | February 18, 2020 00:50 |
How to use "translation" in solidBodyMotionFunction in OpenFOAM | rupesh_w | OpenFOAM Running, Solving & CFD | 5 | August 16, 2016 04:27 |
freelancer/pay:Coding solidworks flow simulation API using microsoft visual studio | Edreez | CFD Freelancers | 1 | December 8, 2015 11:18 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 09:56 |