CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

problem in constructing volTensor and volScalar by components

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2018, 11:26
Default problem in constructing volTensor and volScalar by components
  #1
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14
huangxianbei is on a distinguished road
Hi, Foamers:
I'd like to report a strange problem in implementing a new model- the bifurcation model proposed by Arolla and Durbin. (Modeling rotation and curvature effects within scalar eddy viscosity model framework, 2013, International Journal of Heat and Fluid Flow). The code can be seen in attachments. The compilation is OK in OF-2.3.0. However, when it was applied to the case, the following error occured:

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 void Foam::mag<Foam::Tensor<double> >(Foam::Field<double>&, Foam::UList<Foam::Tensor<double> > const&) at ??:?
#4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::mag<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<Foam::Tensor<d ouble>, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#5 Foam::incompressible::RASModels::bifurcation::f() const at ??:?
#6 Foam::incompressible::RASModels::bifurcation::bifu rcation(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&, Foam::word const&) at ??:?
#7 Foam::incompressible::RASModel::adddictionaryConst ructorToTable<Foam::incompressible::RASModels::bif urcation>::New(Foam::GeometricField<Foam::Vector<d ouble>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#8 Foam::incompressible::RASModel::New(Foam::Geometri cField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#9 Foam::incompressible::turbulenceModel::addturbulen ceModelConstructorToTable<Foam::incompressible::RA SModel>::NewturbulenceModel(Foam::GeometricField<F oam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#10 Foam::incompressible::turbulenceModel::New(Foam::G eometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) at ??:?
#11
at ??:?
#12 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13
at ??:?


As indicated in the error, the mag operation lead to the error. I've checked the code and found it to be caused by the tensor Wij in function f(). As can be seen, the tensor is constructed by OmegaF + neijkwi. The problem is caused by neijkwi, which is constructed by the components:

volTensorField neijkwi = -skew(fvc::grad(U_));
neijkwi.replace(0,w.component(0)-w.component(0));
neijkwi.replace(1,-w.component(2));
neijkwi.replace(2,w.component(1));
neijkwi.replace(3,w.component(2));
neijkwi.replace(4,w.component(0)-w.component(0));
neijkwi.replace(5,w.component(0));
neijkwi.replace(6,-w.component(1));
neijkwi.replace(7,w.component(0));
neijkwi.replace(8,w.component(0)-w.component(0));

The tensor neijkwi can not be generated by tensor operation as the definition is related to the Lavi-Civita symbol, which is not made inline in OF. Therefore, the only way is to create it by its components. And that's the reason for the above error.


If anyone can give some guidence, it will be highly appreciated.

Thanks in advance.


Xianbei
Attached Files
File Type: c bifurcation.C (15.6 KB, 2 views)
File Type: h bifurcation.H (9.7 KB, 2 views)
huangxianbei is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 00:40.