动网格算例中,怎样提取结构物表面某点的位移pointDisplacement?
-
@李东岳
李老师,我试了下,controlDict文件里是这样写的:functions { { // Line 57 const point A = point[222]; vector = A[222] - A[222].oldtime(); Info << vector; } ........ }
运行报错:
Create time [0] [0] [0] --> FOAM FATAL IO ERROR: [0] Found { but expected } [0] [0] file: /home/b408/OpenFOAM/b408-v1912/run_test/DTCHullMoving_t1222_0/system/controlDict at line 57. [0] [0] From function static bool Foam::entry::New(Foam::dictionary&, Foam::Istream&, Foam::entry::inputMode, int) [0] in file db/dictionary/entry/entryIO.C at line 179. [0] FOAM parallel run exiting [0] -------------------------------------------------------------------------- MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD with errorcode 1. NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes. You may or may not see output from other processes, depending on exactly when Open MPI kills them. --------------------------------------------------------------------------
-
@wh3296 请问您解决了这个问题了吗?我现在想要获取整个patch的位移,这是我的代码,但是计算出来的位移是0
forAllConstIter(labelHashSet, patchSet_, iter) { label patchi = iter.key(); vectorField displacement = mesh.Cf().boundaryField()[patchi] - mesh.Cf().oldTime().boundaryField()[patchi]; vectorField Uw = displacement/t.deltaT().value(); vectorField pf = Sfb[patchi]*(p.boundaryField()[patchi] - pRef); vectorField vf = Sfb[patchi] & devRhoReffb[patchi]; fm.first().first() += rho(p)*sum(pf); fm.first().second() += sum(vf); vectorField CPs = (((pf + vf)&IE_) * (Uw&IE_))*IE_; fm.second().first() += sum(CPs); fm.second().second() = IE_; }