Issue with volTensorField calculation
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. |
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 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 |
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. |
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(); |
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 |
Hello Hrvoje, thank you for your response.
What do you mean by "plain field" and then use the COPY of the mesh.C() field? |
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 |
All times are GMT -4. The time now is 22:13. |