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

Issue with volTensorField calculation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By cnsidero
  • 1 Post By hjasak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2014, 09:20
Default Issue with volTensorField calculation
  #1
New Member
 
Join Date: Aug 2014
Posts: 3
Rep Power: 11
Surly is on a distinguished road
Hello everyone,
I am trying out different ways to calculate Lyapunov exponents for my current calculations.
For one of them I am interested in calculating jacobian of particle positions, as a test I started using the cell centres as my positions
volVectorField Ct = mesh.C();
volTensorField gradCt = fvc::grad(Ct);

However as I run the code (in parallel), I get the error message below.
Having looked at similar things being done in Openfoam where for example the velocity field U is used, I don't understand why it happens.

Any help would be greatly appreciated. Thanks

[25] --> FOAM FATAL ERROR:
[25] Not implemented
[25]
[25] From function slicedFvPatchField<Type>::snGrad()
[25] in file lnInclude/slicedFvPatchField.C at line 171.
Surly is offline   Reply With Quote

Old   October 14, 2014, 11:00
Default
  #2
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22
cnsidero is on a distinguished road
This isn't a solution, simply a diagnosis so apologies if you've already figured this out.

First, as you've found out slicedFvPatch field does not have snGrad defined (not most others). Check out:

Code:
$WM_PROJECT_DIR/finiteVolume/fields/fvPatchFields/basic/sliced/slicedFvPatchField.C
and you'll find many of the members functions and constructors are not implemented.

If you dig into the mesh.C() you'll find it creates a slicedVolVectorField which has internal and boundary fields, the later the cause of the error. Check out line 138 in:

Code:
./finiteVolume/fvMesh/fvMeshGeometry.C
You'll have to figure out an alternate way to compute the gradients of the cell centers that doesn't create a slicedGeometricField. Sorry I'm not more helpful.
Surly likes this.
cnsidero is offline   Reply With Quote

Old   October 14, 2014, 12:27
Default
  #3
New Member
 
Join Date: Aug 2014
Posts: 3
Rep Power: 11
Surly is on a distinguished road
Thanks for the help!
Indeed I did looked at that in the end, and those "sliced" fields will just have to go..... or maybe not....
Anyway, I'll find a way.
Surly is offline   Reply With Quote

Old   October 14, 2014, 13:13
Default
  #4
Senior Member
 
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22
cnsidero is on a distinguished road
Just thought of something, since (I think) you're interested in the Jacobian of _only_ the cell centers of the volume mesh, you could just try returning the internalField of the volume mesh and apply the gradient to that, i.e.:

Code:
volVectorField Ct_i = mesh.C().internalField();
volTensorField gradCt_i = fvc::grad(Ct_i);
I haven't looked at the code and can't confirm it'll work. I'm assuming it's only the undefined snGrad that's not defined so it's just a guess.
cnsidero is offline   Reply With Quote

Old   October 15, 2014, 06:29
Default
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Sorry, Chris, no: internalField is just a field and you need a volField to calculate a gradient.

Please make a plain field; make a COPY of the field C and called grad. However, you are just testing discretisation errors: grad(x) = 1 (in 1-D).

I think you need something different...

Hrv
Surly likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 15, 2014, 11:24
Default
  #6
New Member
 
Join Date: Aug 2014
Posts: 3
Rep Power: 11
Surly is on a distinguished road
Hello Hrvoje, thank you for your response.

What do you mean by "plain field" and then use the COPY of the mesh.C() field?
Surly is offline   Reply With Quote

Old   October 15, 2014, 11:40
Default
  #7
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
volVectorField centres
(
IOobject
(
"centres",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimLength
);

centres == mesh.C();

fvc::grad(centres) should now work.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Hand" calculation jet fan in the garage mageno Main CFD Forum 3 August 7, 2021 19:09
Apply a calculation goal results to another calculation surface simo125 FloEFD, FloWorks & FloTHERM 8 November 5, 2014 06:14
Increase in CPU number during the FIRE calculation amin_u50 AVL FIRE 0 August 6, 2014 08:34
Meshing related issue in Flow EFD appu FloEFD, FloWorks & FloTHERM 1 May 22, 2011 08:27
Heat Flux Calculation under REPORTS Alberto Schroth FLUENT 0 May 16, 2000 08:19


All times are GMT -4. The time now is 15:45.