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

To get the magnitude of volVectorField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2006, 06:29
Default Hi All, Can anyone please
  #1
susana
Guest
 
Posts: n/a
Hi All,
Can anyone please inform me as to how I can get the magnitude of a vector defined as volVectorField, which I belive is of type GeometricField. I have tried mag() an a lot of other manipulations. In essence I need to get the magnitude of the velocity U (defined as volVectorField) and multiply it with other values defined as dimensionedScalar. I am getting a compile error.

Please please help.

Thanks in advance,
Susan.
  Reply With Quote

Old   November 15, 2006, 08:13
Default Hi Susan, something like
  #2
Member
 
cosimo bianchini
Join Date: Mar 2009
Location: Florence, Tuscany, Italy
Posts: 88
Rep Power: 17
cosimobianchini is on a distinguished road
Send a message via Skype™ to cosimobianchini
Hi Susan,
something like

dimensionedScalar C ("C",p.dimensions(),1000.0) ;
volScalarField magU = C*mag(U);

should work.
U is again the velocity defined as volVectorField

hope it helps

Cosimo
__________________
Cosimo Bianchini

Ergon Research s.r.l.
Via Panciatichi, 92
50127 Florence - ITALY
Tel: +39 055 0763716
Mob: +39 320 9460153
e-mail: cosimo.bianchini@ergonresearch.it
URL: www.ergonresearch.it
cosimobianchini is offline   Reply With Quote

Old   November 15, 2006, 08:21
Default Thanks for the response, my pr
  #3
susana
Guest
 
Posts: n/a
Thanks for the response, my problem is like this

scalar x, y, z

z = x*y*mag(U) where U is volVectorField

gives me an error
no match for 'operator=' in 'Re = Foam::operator/(const Foam::tmp<foam::geometricfield<type,> >&, const Foam::dimensioned<double>&) [with Type = double, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::dimensioned<double>&)((const Foam::dimensioned<double>*)(& nu))))'
/home/abrahasm/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/dimensionedScalarFwd .H:45: note: candidates are: Foam::dimensioned<double>& Foam::dimensioned<double>::operator=(const Foam::dimensioned<double>&)


Please help.
  Reply With Quote

Old   November 15, 2006, 08:32
Default If with scalar you mean just d
  #4
Member
 
cosimo bianchini
Join Date: Mar 2009
Location: Florence, Tuscany, Italy
Posts: 88
Rep Power: 17
cosimobianchini is on a distinguished road
Send a message via Skype™ to cosimobianchini
If with scalar you mean just dimensionedScalar the problem is:

z must be a volScalarField

Cosimo
__________________
Cosimo Bianchini

Ergon Research s.r.l.
Via Panciatichi, 92
50127 Florence - ITALY
Tel: +39 055 0763716
Mob: +39 320 9460153
e-mail: cosimo.bianchini@ergonresearch.it
URL: www.ergonresearch.it
cosimobianchini is offline   Reply With Quote

Old   November 15, 2006, 08:34
Default Hi Susan, you get the error b
  #5
Member
 
Tommaso Lucchini
Join Date: Mar 2009
Posts: 87
Rep Power: 17
lucchini is on a distinguished road
Hi Susan,
you get the error because you try to assign to a scalar variable the product between a scalarField and a volScalarField.
You can get it working if you write:

volScalarField z = x*y*mag(U)

I hope it has been useful,
bye

Tommaso
lucchini is offline   Reply With Quote

Old   November 16, 2006, 07:53
Default Thanks so much! It takes a whi
  #6
susana
Guest
 
Posts: n/a
Thanks so much! It takes a while to understand how the different classes are structured.
  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
Taking the absolute value of a volVectorField or a volTensorField kupiainen OpenFOAM 3 July 25, 2019 14:00
Combining 3 volScalarFields to form a volVectorField srinath OpenFOAM 1 August 13, 2008 02:27
How to update volVectorField velocity swlee OpenFOAM Running, Solving & CFD 0 June 18, 2008 05:57
VolVectorField of complex numbers quba OpenFOAM 0 December 17, 2007 09:06
Why doesnbt the macro forall work for the volVectorField variable siwen OpenFOAM Running, Solving & CFD 2 February 24, 2006 16:27


All times are GMT -4. The time now is 15:57.