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

compute compoents of U

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2020, 09:21
Unhappy compute compoents of U
  #1
New Member
 
zaki
Join Date: Nov 2018
Posts: 17
Rep Power: 7
zikou55 is on a distinguished road
Hello, I want to define new variable in the solver
F=U.component(1)*beta; //beta is an constant

but I got an error

error: no match for ‘operator=’ (operand types are ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ and ‘Foam::tmp<Foam::GeometricField<Foam::Vector<doubl e>, Foam::fvPatchField, Foam::volMesh> >’)
F=U.component(1)*beta;

please any help or suggestion and Thank you .
zikou55 is offline   Reply With Quote

Old   September 29, 2020, 06:10
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Please provide more information. Which class type is your object F? Is your usage of U.component(1) correct?

Based on Doxygen you do have a volVectorField for the velocity which is a GeometricField (Template Class) while the Type of the template is Vector. Hence, you should get access as given below:

Code:
// F has to be a volScalarField with appropriate units
F = U.y() * dimensionedScalar()
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 29, 2020, 06:16
Default
  #3
New Member
 
zaki
Join Date: Nov 2018
Posts: 17
Rep Power: 7
zikou55 is on a distinguished road
Thank you very much .
the problem resolved
zikou55 is offline   Reply With Quote

Reply

Tags
compot u


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
compute compoents of U zikou55 OpenFOAM Running, Solving & CFD 1 September 29, 2020 04:36
Compute mean vorticity field odellar OpenFOAM Post-Processing 8 January 9, 2017 09:03
Compute Cluster with diskless compute nodes Pauli Hardware 0 October 6, 2015 16:48
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
How do I compute the normal vector to a surface with FEM Vasilis Main CFD Forum 3 July 31, 2009 07:59


All times are GMT -4. The time now is 18:54.