@李东岳 我看了您提供的PINN算例,感觉目前还没有真正跟of结合起来,是吧?只不过用了of的c++编译环境,可以这么理解么?
chengan.wang
帖子
-
OpenFOAM libtorch tutorial step by step -
OpenFOAM libtorch tutorial step by step@李东岳 谢谢李老师
-
OpenFOAM libtorch tutorial step by step@李东岳 李老师,http://dyfluid.com/pinn.html ,#include "output.H"这个文件能补充上传么,想研究一下您的完整代码,谢谢
-
OpenFOAM libtorch tutorial step by step@李东岳 在 OpenFOAM libtorch tutorial step by step 中说:
更新gcc之后你openfoam就编译不了了。那你尝试安装老版本的libtorch吧
李老师,我用的是ubuntu18.04,Of2.4.0,您有推荐的libtorch版本么
-
数据文件格式FEPolygon转换FETriangle@李东岳 就是想把离散点数据
-17.00000000 -59.58333206 0.00000000 302.77685547 -17.00000000 -62.50000000 0.00000000 302.77685547 -17.00000000 -65.41666412 0.00000000 302.77685547 -17.00000000 -68.33333588 0.00000000 302.77685547 -17.00000000 -71.25000000 0.00000000 302.77685547 -17.00000000 -74.16666412 0.00000000 302.77682495 -17.00000000 -77.08333588 0.00000000 302.77679443 -17.00000000 -80.00000000 0.00000000 302.77664185
整理成这样:
VARIABLES = "X""Y""Z" Nodes=39888, Elements=78526, ZONETYPE=FETriangle -17.00000000 -59.58333206 0.00000000 302.77685547 -17.00000000 -62.50000000 0.00000000 302.77685547 -17.00000000 -65.41666412 0.00000000 302.77685547 -17.00000000 -68.33333588 0.00000000 302.77685547 -17.00000000 -71.25000000 0.00000000 302.77685547 -17.00000000 -74.16666412 0.00000000 302.77682495 -17.00000000 -77.08333588 0.00000000 302.77679443 -17.00000000 -80.00000000 0.00000000 302.77664185 1 2 3 3 4 1 5 6 2 2 1 5 7 8 6 6 5 7
-
数据文件格式FEPolygon转换FETriangle@Prometheus10 谢谢哈,我主要目的是建立节点数据之间的关联,三角形,缩放只能是个视觉上的平面。
-
数据文件格式FEPolygon转换FETriangle用paraview或tecplot那能不能把曲面上的数据投影到一个规则的矩形平面上呢?
-
数据文件格式FEPolygon转换FETriangle大家好,
我目前用starccm做了一个仿真,数据能用tecplot导出ZONETYPE=FEPolygon形式,如何进一步转换成ZONETYPE=FETriangle?
谢谢。 -
paraview做多个切面,然后在每个面上对物理量积分大家好,目前我可以输出温度场的三维数据,比如
我想垂直于z轴做100个等间距垂直切面,在每个切面上对温度求积分并取平均值。
\begin{equation}
\int_{A} T dx dy /A
\end{equation}
然后沿着z轴画出一条温度平均值曲线。谢谢大家!
-
如何在src文件中创建标量物理filed并且调用@李东岳 非常感谢李老师,终于搞定,能输出数据了,但还需要进一步验证是否正确。差点放弃想升级新版本of。
volScalarField& summass = const_cast<volScalarField&>(p.mesh().objectRegistry::lookupObject<volScalarField>("summass")); const label cellIp = p.cell(); scalar& PPC = summass.internalField() [cellIp]; PPC += p.nParticle()*p.mass();
希望对以后需要的朋友有点借鉴作用。特别感谢 @星星星星晴 不厌其烦的解答
-
如何在src文件中创建标量物理filed并且调用@李东岳 李老师,这句命令
volScalarField& summass = p.mesh().objectRegistry::lookupObjectRef<volScalarField>("summass");
又报错了
lnInclude/ParticleCollector.C:745:71: error: ‘class Foam::objectRegistry’ has no member named ‘lookupObjectRef’ volScalarField& summass = p.mesh().objectRegistry::lookupObjectRef<volScalarField>("summass");
-
如何在src文件中创建标量物理filed并且调用@李东岳 李老师,还是不行
const volScalarField& summass = p.mesh().objectRegistry::lookupObject<volScalarField>("summass"); const label cellIp = p.cell(); summass.internalField() [cellIp] += p.nParticle()*p.mass();
编译出错
lnInclude/ParticleCollector.C:749:38: error: assignment of read-only location ‘(&(& summass)->Foam::GeometricField<Type, PatchField, GeoMesh>::internalField<double, Foam::fvPatchField, Foam::volMesh>())->Foam::Field<double>::<anonymous>.Foam::List<double>::<anonymous>.Foam::UList<T>::operator[]<double>(((Foam::label)cellIp))’ summass.internalField() [cellIp] += p.nParticle()*p.mass(); ^ lnInclude/ParticleCollector.C: In instantiation of ‘void Foam::ParticleCollector<CloudType>::postMove(Foam::ParticleCollector<CloudType>::parcelType&, Foam::label, Foam::scalar, const point&, bool&) [with CloudType = Foam::KinematicCloud<Foam::Cloud<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > >; Foam::ParticleCollector<CloudType>::parcelType = Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> >; Foam::label = int; Foam::scalar = double; Foam::point = Foam::Vector<double>]’: parcels/derived/basicKinematicCollidingParcel/makeBasicKinematicCollidingParcelSubmodels.C:53:1: required from here lnInclude/ParticleCollector.C:749:38: error: assignment of read-only location ‘(&(& summass)->Foam::GeometricField<Type, PatchField, GeoMesh>::internalField<double, Foam::fvPatchField, Foam::volMesh>())->Foam::Field<double>::<anonymous>.Foam::List<double>::<anonymous>.Foam::UList<T>::operator[]<double>(((Foam::label)cellIp))’ summass.internalField() [cellIp] += p.nParticle()*p.mass();
-
如何在src文件中创建标量物理filed并且调用@李东岳 还是不行
lnInclude/ParticleCollector.C: In member function ‘virtual void Foam::ParticleCollector<CloudType>::postMove(Foam::ParticleCollector<CloudType>::parcelType&, Foam::label, Foam::scalar, const point&, bool&)’: lnInclude/ParticleCollector.C:746:43: error: ‘const InternalField {aka const class Foam::Field<double>}’ has no member named ‘ref’ scalar& PPC = summass.internalField().ref() [cellIp]; ^ lnInclude/ParticleCollector.C: In member function ‘virtual void Foam::ParticleCollector<CloudType>::postMove(Foam::ParticleCollector<CloudType>::parcelType&, Foam::label, Foam::scalar, const point&, bool&)’: lnInclude/ParticleCollector.C:746:43: error: ‘const InternalField {aka const class Foam::Field<double>}’ has no member named ‘ref’ scalar& PPC = summass.internalField().ref() [cellIp];
-
如何在src文件中创建标量物理filed并且调用@tens 应该是这样的,感觉应该带个指针啥的
-
如何在src文件中创建标量物理filed并且调用@李东岳 李老师,按照下列代码
const label cellIp = p.cell(); scalar PPC = summass.internalField() [cellIp]; PPC += p.nParticle()*p.mass();
编译通过了,也能算了,但是好像没有赋值进去,结果是0
FoamFile { version 2.0; format binary; class volScalarField; location "0.0002"; object summass; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 0 0 0 0 0 0]; internalField uniform 0; boundaryField { walls { type calculated; value uniform 0; } }
-
如何在src文件中创建标量物理filed并且调用@李东岳 我把
const volScalarField& summass = p.mesh().objectRegistry::lookupObject<volScalarField>("summass");
挪到程序前面了,还是同样的错误
-
如何在src文件中创建标量物理filed并且调用@李东岳 编译倒是能通过了,但是运行算例log文件显示错误
[12] [12] [12] --> FOAM FATAL ERROR: [12] request for volScalarField summass from objectRegistry region0 failed available objects of type volScalarField are 19 ( thermo:mu thermo:psi K h kappa air rho k Cp dpdt thermo:psi_0 alphat dQ p T mut H2O epsilon thermo:alpha ) [12] [12] [12] From function objectRegistry::lookupObject<Type>(const word&) const [12] in file /home/chengan/OpenFOAM/OpenFOAM-2.4.0/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 198. [12]
-
如何在src文件中创建标量物理filed并且调用@李东岳 李老师,又出现了之前的问题:
lnInclude/ParticleCollector.C: In member function ‘virtual void Foam::ParticleCollector<CloudType>::postMove(Foam::ParticleCollector<CloudType>::parcelType&, Foam::label, Foam::scalar, const point&, bool&)’: lnInclude/ParticleCollector.C:750:31: error: ‘const volScalarField {aka const class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘internalFieldRef’ scalar& PPC = summass.internalFieldRef() [cellIp]; ^ lnInclude/ParticleCollector.C: In member function ‘virtual void Foam::ParticleCollector<CloudType>::postMove(Foam::ParticleCollector<CloudType>::parcelType&, Foam::label, Foam::scalar, const point&, bool&)’: lnInclude/ParticleCollector.C:750:31: error: ‘const volScalarField {aka const class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘internalFieldRef’ scalar& PPC = summass.internalFieldRef() [cellIp];
我用grep查了一下,有些函数中用的是internalField()而查不到internalFieldRef(),但如果采用
scalar& PPC = summass.internalField() [cellIp]
错误如下
lnInclude/ParticleCollector.C:750:53: error: binding ‘const double’ to reference of type ‘Foam::scalar& {aka double&}’ discards qualifiers scalar& PPC = summass.internalField()[cellIp];
-
如何在src文件中创建标量物理filed并且调用@李东岳 麻烦李老师了。
const volScalarField& summass = p.mesh().objectRegistry::lookupObject<volScalarField>("summass"); const label cellIp = p.cell(); scalar& PPC = summass.internalField()[cellIp]; PPC += p.nParticle()*p.mass();
还是有错误如下
lnInclude/ParticleCollector.C:750:53: error: binding ‘const double’ to reference of type ‘Foam::scalar& {aka double&}’ discards qualifiers scalar& PPC = summass.internalField()[cellIp];
-
如何在src文件中创建标量物理filed并且调用@李东岳 在 如何在src文件中创建标量物理filed并且调用 中说:
p.mesh().objectRegistry::lookupObject<volScalarField>("summass")
lnInclude/ParticleCollector.C: In member function ‘virtual void Foam::ParticleCollector<CloudType>::postMove(Foam::ParticleCollector<CloudType>::parcelType&, Foam::label, Foam::scalar, const point&, bool&)’: lnInclude/ParticleCollector.C:750:31: error: ‘const volScalarField {aka const class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘primitiveFieldRef’ scalar& PPC = summass.primitiveFieldRef() [cellIp]; ^ lnInclude/ParticleCollector.C: In member function ‘virtual void Foam::ParticleCollector<CloudType>::postMove(Foam::ParticleCollector<CloudType>::parcelType&, Foam::label, Foam::scalar, const point&, bool&)’: lnInclude/ParticleCollector.C:750:31: error: ‘const volScalarField {aka const class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘primitiveFieldRef’ scalar& PPC = summass.primitiveFieldRef() [cellIp];
好像是没有 member named ‘primitiveFieldRef’,我用的是of2.4.0