CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

volVolumeField from volSurfaceField

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   April 13, 2011, 13:53
Default volVolumeField from volSurfaceField
New Member
Join Date: Sep 2010
Location: Russia , Moscow.
Posts: 14
Rep Power: 9
Zato_Ichi is on a distinguished road
Greetings !

To make a volVolumeField consisting of 3 volScalarField i tried this code? but it doesn't work.

volTensorField gradq = fvc::grad(q);

volScalarField qx = gradq.component(vector::X);
volScalarField qy = gradq.component(vector::Y);
volScalarField qz = gradq.component(vector::Z);

diaggradq.internalField() = vectorField(qx,qy,qz) ;
there q is volVectorField and diaggradq is volVectorField too.

The main goal is to make a vector (dq/dx , dq/dy , dq/dz), and I can't think how to do it without extracting diagonal elements from grad(q) tensor.

Thanks for helping, best regards.
Zato_Ichi is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 19:07.