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

To declare a field of vector type

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2021, 07:09
Default To declare a field of vector type
  #1
New Member
 
Mk
Join Date: Sep 2021
Posts: 5
Rep Power: 4
mkgupta is on a distinguished road
I want to create a volvectorfield in the solver. Please find the code belwo, this will be more clear.
I have tried it like this:

volvectorfield phi(h, 0 ,0);
where 'h' is another scalar field already defined.

But this throws an error.
Can anyone help me with this? Thanks in advance.
mkgupta is offline   Reply With Quote

Old   November 27, 2021, 07:47
Default
  #2
Member
 
Join Date: Jun 2019
Posts: 41
Rep Power: 6
Voulet is on a distinguished road
Hi.
Try : volvectorfield phi(h * vector(1,0,0));
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. »
Voulet is offline   Reply With Quote

Old   November 27, 2021, 23:18
Default
  #3
New Member
 
Mk
Join Date: Sep 2021
Posts: 5
Rep Power: 4
mkgupta is on a distinguished road
Thanks, it worked.
mkgupta 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
potential flows, helmholtz decomposition and other stuffs pigna Main CFD Forum 1 October 26, 2017 08:34
Steady simulation does not iterate in Time=1 agustinvo OpenFOAM Running, Solving & CFD 3 November 19, 2015 04:57
[General] How to create an additional vector with {Field 4, Field 5, Field 6} Bombacar ParaView 1 August 15, 2015 18:05
Sgimpi pere OpenFOAM 27 September 24, 2011 07:57
Ld_library_path scottneh OpenFOAM 9 November 21, 2009 09:15


All times are GMT -4. The time now is 04:17.