|
[Sponsors] |
how to define a vector5(5 primitive variables) in Block matrix? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 2, 2014, 23:15 |
how to define a vector5(5 primitive variables) in Block matrix?
|
#1 |
Member
Hua
Join Date: May 2012
Posts: 31
Rep Power: 14 |
Dear Foamers,
Recently, I want to define a vector5(5 primitive variables,u,v,w,p,T) in block matrix. vector2,3,4,6,8 have been defined in OpenFOAM. So I added some codes to define vector5. follow is my codes //vector5 and some relative variables***************************************** ******************************** // #include "ExpandTensorN.H" #define nGroups 5 typedef Foam::VectorN<scalar, nGroups> vector5; typedef Foam::TensorN<scalar, nGroups> tensor5; typedef Foam:iagTensorN<scalar, nGroups> diagTensor5; typedef Foam::SphericalTensorN<scalar, nGroups> sphericalTensor5; typedef dimensioned<vector5> dimensionedVector5; typedef dimensioned<tensor5> dimensionedTensor5; typedef dimensioned<diagTensor5> dimensionedDiagTensor5; typedef dimensioned<sphericalTensor5> dimensionedSphericalTensor5; typedef GeometricField<vector5, fvPatchField, volMesh> volVector5Field; typedef GeometricField<tensor5, fvPatchField, volMesh> volTensor5Field; typedef GeometricField<diagTensor5, fvPatchField, volMesh> voldiagTensor5Field; typedef GeometricField<sphericalTensor5, fvPatchField, volMesh> volsphericalTensor5Field; // ************************************************** *********************** // Unlucky, compilation is error. Could anyone can help me? |
|
June 3, 2014, 04:13 |
|
#2 |
Member
Hua
Join Date: May 2012
Posts: 31
Rep Power: 14 |
My openFoam is openfoam-extend-3.0.
|
|
June 4, 2014, 01:18 |
|
#3 |
Member
Hua
Join Date: May 2012
Posts: 31
Rep Power: 14 |
I had solved this problem.Thanks
|
|
May 14, 2015, 13:58 |
|
#4 |
New Member
Anant Grewal
Join Date: Mar 2009
Posts: 9
Rep Power: 17 |
Could you please post how you did this? I have the same requirement for a vector of 5 scalars.
Thanks Anant |
|
May 15, 2015, 11:46 |
|
#5 |
Member
Hua
Join Date: May 2012
Posts: 31
Rep Power: 14 |
Hi,Anant,
I remembered there some change should be done in source codes in OF-ext3,0. Since vector2,3,4,6,8 have been defined in OpenFOAM. So I added some codes to define vector5 just like vector2,3,4,6,8 in source codes. follow is my codes //vector5 and some relative variables***************************************** ******************************** // #include "ExpandTensorN.H" #define nGroups 5 typedef Foam::VectorN<scalar, nGroups> vector5; typedef Foam::TensorN<scalar, nGroups> tensor5; typedef Foam:iagTensorN<scalar, nGroups> diagTensor5; typedef Foam::SphericalTensorN<scalar, nGroups> sphericalTensor5; typedef dimensioned<vector5> dimensionedVector5; typedef dimensioned<tensor5> dimensionedTensor5; typedef dimensioned<diagTensor5> dimensionedDiagTensor5; typedef dimensioned<sphericalTensor5> dimensionedSphericalTensor5; typedef GeometricField<vector5, fvPatchField, volMesh> volVector5Field; typedef GeometricField<tensor5, fvPatchField, volMesh> volTensor5Field; typedef GeometricField<diagTensor5, fvPatchField, volMesh> voldiagTensor5Field; typedef GeometricField<sphericalTensor5, fvPatchField, volMesh> volsphericalTensor5Field; // ************************************************** *********************** // Good luck. There some more change may be needed. Try it and follow the error to find something needed. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 23:03 |
UDF to define variables | orlik | FLUENT | 0 | March 11, 2010 12:15 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 09:23 |
PHI file structure | Eugene | Phoenics | 9 | November 2, 2001 23:00 |
writing a 3d NS solver in the primitive variables! | lostsoul | Main CFD Forum | 4 | October 20, 2000 03:52 |