|
[Sponsors] |
October 8, 2020, 10:15 |
How do you extract a component of a tensor
|
#1 |
New Member
王子阳
Join Date: Aug 2019
Posts: 29
Rep Power: 7 |
Hello everyone!
I now have a tensor S, whose type is volSymmTensorField, i try to extract its component "zz", but it had an error. My corresponding code is as follows: const volSymmTensorField S = symm(gradU); const volScalarField Z = S.zz(); And the error is as follows: DCNM.C: In member function ‘Foam::dimensionedVector Foam::compressible::LESNonlinearModels:CNM::C(co nst volTensorField&) const’: DCNM.C:83:28: error: ‘const volSymmTensorField’ has no member named ‘zz’ const volScalarField Z = S.zz(); How can I solve this problem? I think this operation is very common. best wishes! ziyang |
|
October 8, 2020, 10:17 |
|
#2 |
Member
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 10 |
I just came by this post with a file open at this line:
Code:
volScalarField Udx(Ud.component(vector::X)); Edit: Oh sorry I read to fast, you are looking for a tensor component, maybe an adaptation of this then. Found this with a grep Code:
finiteVolume/lnInclude/eddy.C:286: const vector axisDir = tensor::I.vectorComponent(dir1_); |
|
October 11, 2020, 23:39 |
|
#3 | |
New Member
王子阳
Join Date: Aug 2019
Posts: 29
Rep Power: 7 |
Quote:
Thank you very much! This is the code I want!! My model now runs very stable. best wishes! ziyang |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM extended 4.0 Error with Multinode Set-up | Liweix | OpenFOAM Running, Solving & CFD | 1 | February 18, 2020 01:50 |
wmake libso error while compiling library for dynamic mesh | Naveed Salman | OpenFOAM Programming & Development | 3 | August 28, 2017 21:53 |
extract certain vector component while OF is running | ngcw1986 | OpenFOAM Running, Solving & CFD | 0 | August 4, 2012 04:13 |
how to extract vector from tensor ? | Cyp | OpenFOAM Programming & Development | 6 | March 3, 2011 08:47 |
sampling a strain-rate tensor single component | vkrastev | OpenFOAM Post-Processing | 0 | March 2, 2010 08:21 |