Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the volume coupling case of the old version is replicated in the new version adapter, the data does not match during the writing process #342

Open
freshman-Tan opened this issue Oct 9, 2024 · 1 comment

Comments

@freshman-Tan
Copy link

my system:Ubuntu 22.04.4 LTS
preCICE:v1.3.1
openfoamv2006
new version:openfoam_adapter-1.3.1
old version: arpans16/openfoam-adapter-volCoup: 为精确的 openfoam 适配器添加体积耦合器 - 个人作品 --- arpans16/openfoam-adapter-volCoup: Adding volumetric coupling to the precice openfoam adapter - personal work (github.com)

The old version of the adapter added an AITS module and two Locationtype_: volume and volsurf to achieve volume coupling, and provided tutorials for verification, I successfully added the AITS module and two Locationtype_: volume and volsurf in the new version, and the compilation was successful. But when I run the original tutorials, I get the precice error:

ERROR: Input sizes are inconsistent attempting to write 3D data "Velocity" to mesh "flowSolve-Mesh-vol". You passed 36707 vertices and 38043 data components, but we expected 110121 data components (3 x 36707).

All the data exchanged in my run case is similar to the speed, I added some debugging information to the write function in the AITS/VelocityAIT.C file and the writeCouplingData function in Interface.C, and here's the detailed output information:

---[preciceAdapter] [DEBUG] Writing data for Velocity

---[preciceAdapter] [DEBUG] Number of vertices: 36707

---[preciceAdapter] [DEBUG] Total number of cells: 12013

---[preciceAdapter] [DEBUG] Mesh dimension: 3

---[preciceAdapter] [DEBUG] Write: first value of U at bufferIndex: 0 is 0.000000

---[preciceAdapter] [DEBUG] Processing cell 0, bufferIndex: 0

---[preciceAdapter] [DEBUG] Processing cell 1000, bufferIndex: 3000

---[preciceAdapter] [DEBUG] Processing cell 2000, bufferIndex: 6000

---[preciceAdapter] [DEBUG] Processing cell 3000, bufferIndex: 9000

---[preciceAdapter] [DEBUG] Processing cell 4000, bufferIndex: 12000

---[preciceAdapter] [DEBUG] Processing cell 5000, bufferIndex: 15000

---[preciceAdapter] [DEBUG] Processing cell 6000, bufferIndex: 18000

---[preciceAdapter] [DEBUG] Processing cell 7000, bufferIndex: 21000

---[preciceAdapter] [DEBUG] Processing cell 8000, bufferIndex: 24000

---[preciceAdapter] [DEBUG] Processing cell 9000, bufferIndex: 27000

---[preciceAdapter] [DEBUG] Processing cell 10000, bufferIndex: 30000

---[preciceAdapter] [DEBUG] Processing cell 11000, bufferIndex: 33000

---[preciceAdapter] [DEBUG] Processing cell 12000, bufferIndex: 36000

---[preciceAdapter] [DEBUG] Final bufferIndex: 38043

---[preciceAdapter] [DEBUG] Number of written data components: 38043

---[preciceAdapter] [DEBUG] Expected number of data components: 110121

--> FOAM FATAL ERROR:

Error in the preCICE adapter:

Mismatch in written data size for Velocity. Expected: 110121, Actual: 38043

From void adapterInfo(std::string, std::string)

in file Utilities.C at line 32.

FOAM exiting

Looking for any time directories without results (e.g. stray functionObjectProperties files, see openfoam-adapter issue #26 on GitHub)...

@freshman-Tan
Copy link
Author

New statement:

The old version adapter added an AITS module and two Locationtype_:volume and volsurf to implement volume coupling, and provided tutorials for verification. I successfully added the AITS module and two Locationtype_:volume and volsurf in the new adapter version, and compiled successfully, but when I ran the original tutorials, I encountered the following error (all the data exchanged in the case I ran was similar to velocity, and I used the new version adapter's Locationtype_:volumeCentre and the old version adapter's Locationtype_:volume and volsurf, and all had the same error):

tlk@tlk-virtual-machine:~/OpenFOAM/tlk-v2006/run/openfoam-adapter-1.3.1_ooo/try/volCoup-oneWay/flowSolve$ ./run.sh
wmake ../../solvers/flowSolveFoam
g++ -std=c++11 -m64 -pthread -DOPENFOAM=2006 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/finiteVolume/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/meshTools/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/sampling/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/transportModels/compressible/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/thermophysicalModels/basic/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/thermophysicalModels/radiation/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/TurbulenceModels/compressible/lnInclude -iquote. -IlnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude -I/home/tlk/OpenFOAM/OpenFOAM-v2006/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/flowSolveFoam.o -L/home/tlk/OpenFOAM/OpenFOAM-v2006/platforms/linux64GccDPInt32Opt/lib
-lfiniteVolume -lfvOptions -lmeshTools -lsampling -lcompressibleTransportModels -lfluidThermophysicalModels -lradiationModels -lspecie -lturbulenceModels -lcompressibleTurbulenceModels -latmosphericModels -lOpenFOAM -ldl
-lm -o /home/tlk/OpenFOAM/tlk-v2006/platforms/linux64GccDPInt32Opt/bin/flowSolveFoam
Preparing and running the flowSolve participant...
/---------------------------------------------------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: v2006 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
Build : v2006 OPENFOAM=2006
Arch : "LSB;label=32;scalar=64"
Exec : blockMesh
Date : Oct 09 2024
Time : 22:42:58
Host : tlk-virtual-machine
PID : 20745
I/O : uncollated
Case : /home/tlk/OpenFOAM/tlk-v2006/run/openfoam-adapter-1.3.1_ooo/try/volCoup-oneWay/flowSolve
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from "system/blockMeshDict"
Creating block edges
No non-planar block faces defined
Creating topology blocks
Creating topology patches

Creating block mesh topology
--> FOAM Warning :
From Foam::polyMesh::polyMesh(const Foam::IOobject&, Foam::pointField&&, const cellShapeList&, const faceListList&, const wordList&, const Foam::PtrListFoam::dictionary&, const Foam::word&, const Foam::word&, bool)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 915
Found 6 undefined faces in mesh; adding to default patch defaultFaces

Check topology

Basic statistics
	Number of internal faces : 2
	Number of boundary faces : 14
	Number of defined boundary faces : 14
	Number of undefined boundary faces : 0
Checking patch -> block consistency

Creating block offsets
Creating merge list (topological search)...

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 1
Block 0 cell size :
i : 0.0123864236173 .. 0.00247728472346
j : 0.00232699027775 .. 0.0349048541662
k : 0.4 .. 0.4

Block 1 cell size :
    i : 0.0024958960536 .. 0.012479480268
    j : 0.00232699027775 .. 0.0349048541662
    k : 0.4 .. 0.4

Block 2 cell size :
    i : 0.0392156862745 .. 0.0392156862745
    j : 0.00232699027775 .. 0.0349048541662
    k : 0.4 .. 0.4

There are no merge patch pairs

Writing polyMesh with 0 cellZones

Mesh Information

boundingBox: (-0.5 0 0) (3 0.5 0.4)
nPoints: 24696
nCells: 12013
nFaces: 48386
nInternalFaces: 23692

Patches

patch 0 (start: 23692 size: 41) name: inlet
patch 1 (start: 23733 size: 41) name: outlet
patch 2 (start: 23774 size: 293) name: top
patch 3 (start: 24067 size: 81) name: slip-bottom
patch 4 (start: 24148 size: 51) name: bottom
patch 5 (start: 24199 size: 161) name: interface
patch 6 (start: 24360 size: 24026) name: defaultFaces

End

/---------------------------------------------------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: v2006 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
Build : v2006 OPENFOAM=2006
Arch : "LSB;label=32;scalar=64"
Exec : checkMesh
Date : Oct 09 2024
Time : 22:42:59
Host : tlk-virtual-machine
PID : 20747
I/O : uncollated
Case : /home/tlk/OpenFOAM/tlk-v2006/run/openfoam-adapter-1.3.1_ooo/try/volCoup-oneWay/flowSolve
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Time = 0

Mesh stats
points: 24696
internal points: 0
faces: 48386
internal faces: 23692
cells: 12013
faces per cell: 6
boundary patches: 7
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 12013
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
Patch Faces Points Surface topology
inlet 41 84 ok (non-closed singly connected)
outlet 41 84 ok (non-closed singly connected)
top 293 588 ok (non-closed singly connected)
slip-bottom 81 164 ok (non-closed singly connected)
bottom 51 104 ok (non-closed singly connected)
interface 161 324 ok (non-closed singly connected)
defaultFaces 24026 24696 ok (non-closed singly connected)

Checking faceZone topology for multiply connected surfaces...
No faceZones found.

Checking basic cellZone addressing...
No cellZones found.

Checking geometry...
Overall domain bounding box (-0.5 0 0) (3 0.5 0.4)
Mesh has 2 geometric (non-empty/wedge) directions (1 1 0)
Mesh has 2 solution (non-empty) directions (1 1 0)
All edges aligned with or perpendicular to non-empty directions.
Boundary openness (-5.95502088768e-18 -1.17546934044e-16 -2.36226616626e-16) OK.
Max cell openness = 2.13849956364e-16 OK.
Max aspect ratio = 16.8525355069 OK.
Minimum face area = 5.76461746671e-06. Maximum face area = 0.015686274512. Face area magnitudes OK.
Min volume = 2.30584698668e-06. Max volume = 0.000547527124249. Total volume = 0.7. Cell volumes OK.
Mesh non-orthogonality Max: 0 average: 0
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 5.82550106883e-14 OK.
Coupled point location match (average 0) OK.

Mesh OK.

End

/---------------------------------------------------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: v2006 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
Build : v2006 OPENFOAM=2006
Arch : "LSB;label=32;scalar=64"
Exec : flowSolveFoam
Date : Oct 09 2024
Time : 22:43:00
Host : tlk-virtual-machine
PID : 20752
I/O : uncollated
Case : /home/tlk/OpenFOAM/tlk-v2006/run/openfoam-adapter-1.3.1_ooo/try/volCoup-oneWay/flowSolve
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

PIMPLE: Operating solver in PISO mode

Reading thermophysical properties

Selecting thermodynamics package
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}

--> FOAM Warning :
From bool Foam::GeometricField<Type, PatchField, GeoMesh>::readIfPresent() [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
in file /home/tlk/OpenFOAM/OpenFOAM-v2006/src/OpenFOAM/lnInclude/GeometricField.C at line 108
read option IOobject::MUST_READ or MUST_READ_IF_MODIFIED suggests that a read constructor for field rho would be more appropriate.
Reading field U

Creating field Dpdt

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type laminar
Selecting laminar stress model Stokes

Reading g

Reading hRef
Calculating field g.h

Reading field p_rgh

Creating field dpdt

Creating field kinetic energy K

No MRF models present

Radiation model not active: radiationProperties not found
Selecting radiationModel none
No finite volume options present
Courant Number mean: 0 max: 0

Starting time loop

---[preciceAdapter] Loaded the OpenFOAM-preCICE adapter - v1.3.1.
---[preciceAdapter] Reading preciceDict...
SolverType: ||1---[precice] This is preCICE version 3.1.1
---[precice] Revision info: no-info [git failed to run]
---[precice] Build type: Release (without debug log)
---[precice] Configuring preCICE with configuration "../precice-config.xml"
---[precice] I am participant "flowSolve"
---[preciceAdapter] Internal faces = 23692
---[preciceAdapter] Patch size = 7
---[preciceAdapter] Boundary faces = 24694
---[precice] Setting up primary communication to coupling partner/s
---[precice] Primary ranks are connected
---[precice] Setting up preliminary secondary communication to coupling partner/s
---[precice] Prepare partition for mesh flowSolve-Mesh-vol
---[precice] Gather mesh flowSolve-Mesh-vol
---[precice] Send global mesh flowSolve-Mesh-vol
---[precice] Prepare partition for mesh flowSolve-Mesh-volSurf
---[precice] Gather mesh flowSolve-Mesh-volSurf
---[precice] Send global mesh flowSolve-Mesh-volSurf
---[precice] Setting up secondary communication to coupling partner/s
---[precice] Secondary ranks are connected
---[precice] iteration: 1, time-window: 1, time: 0 of 10, time-window-size: 0.01, max-time-step-size: 0.01, ongoing: yes, time-window-complete: no,
---[preciceAdapter] preCICE was configured and initialized
---[preciceAdapter] [DEBUG] Writing data for interface 0
---[preciceAdapter] [DEBUG] Writing data for interface 1
---[preciceAdapter] Setting the solver's endTime to infinity to prevent early exits. Only preCICE will control the simulation's endTime. Any functionObject's end() method will be triggered by the adapter. You may disable this behavior in the adapter's configuration.
Courant Number mean: 0 max: 0
Time = 0.01

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
PIMPLE: iteration 1
DILUPBiCGStab: Solving for Ux, Initial residual = 1, Final residual = 7.78951375942e-08, No Iterations 2
DILUPBiCGStab: Solving for Uy, Initial residual = 1, Final residual = 2.6959134457e-07, No Iterations 2
DICPCG: Solving for p_rgh, Initial residual = 0.815645845211, Final residual = 0.00751038250855, No Iterations 89
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 6.87802874908e-05, global = -1.0849523174e-05, cumulative = -1.0849523174e-05
DICPCG: Solving for p_rgh, Initial residual = 0.309794817979, Final residual = 8.7469094214e-09, No Iterations 215
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.43039149227e-10, global = 3.24487586703e-13, cumulative = -1.08495228495e-05
ExecutionTime = 0.77 s ClockTime = 3 s

---[preciceAdapter] [DEBUG] Write: first value of U at bufferIndex: 0 is 0.000000
---[precice] ERROR: Input sizes are inconsistent attempting to write 3D data "Velocity" to mesh "flowSolve-Mesh-vol". You passed 36707 vertices and 38043 data components, but we expected 110121 data components (3 x 36707).
Looking for any time directories without results (e.g. stray functionObjectProperties files, see openfoam-adapter issue #26 on GitHub)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant