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

How to create Uave =(Uavex,Uavey,Uavez)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 12, 2022, 20:51
Default How to create Uave =(Uavex,Uavey,Uavez)
  #1
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 204
Rep Power: 7
farzadmech is on a distinguished road
Hello all
I want to average my velocity field, and save it in another field called Uave. To do this, first I create Uave;
Code:
volVectorField Uave(U);
Uave = 0.0*Uave;
Now, we have Uave. Then I averaged U to get Uavex, Uavey, Uavez;
Code:
Uavex = gAverage(U.component(0))
Uavey = gAverage(U.component(1))
Uavez = gAverage(U.component(2))
My main question is that how to put Uave =(Uavex,Uavey,Uavez). Since one side is dimensioned and othe is just a scalar. Also, sizes are not equal. What should I do?

Thanks,
Farzad
farzadmech is offline   Reply With Quote

Old   April 12, 2022, 23:11
Default
  #2
Member
 
Join Date: Jun 2019
Posts: 41
Rep Power: 6
Voulet is on a distinguished road
Hello. I don't fully understand. The result of the average of U_X is a scalar as you said. Thus you get 3 scalars finally. You can store them in a vector if you like


vector Uave = vector(Uavex, Uavey, Uavez);


but I don't see how to transform this in a "field".
__________________
« 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

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
create the file *.foam phongstar OpenFOAM 12 October 14, 2018 18:06
[GAMBIT] How to plot S pipe mariam.sara ANSYS Meshing & Geometry 36 November 7, 2013 15:22
[ANSYS Meshing] is it possible to create virtual edges on the blades er_ijaz ANSYS Meshing & Geometry 0 November 3, 2013 05:15
[DesignModeler] Design Modeller create surface papis ANSYS Meshing & Geometry 0 October 31, 2013 13:52
About create interface! xinzhiyu2008 STAR-CCM+ 2 August 6, 2010 20:47


All times are GMT -4. The time now is 20:49.