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

Creating a symmTensorField from a scalarField

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

Like Tree1Likes
  • 1 Post By Bernhard

Reply
 
LinkBack Thread Tools Display Modes
Old   September 29, 2011, 11:51
Post Creating a symmTensorField from a scalarField
  #1
New Member
 
Bill
Join Date: Jun 2011
Location: UK
Posts: 14
Rep Power: 6
maninthemail is on a distinguished road
Greetings,

I'm implementing a boundary condition for a symmTensor variable. I calculate a scalarField, and then want to apply it to the diagonal components of the symmTensorField. The fields are turbulent intensity and reynolds stress, though that really isn't important. The relevant (updateCoeffs) part of the code is as follows...

Code:
if (updated()) return;

// boundary velocity
const fvPatchVectorField& Up = patch().lookupPatchField<volVectorField, vector>(UName_);

// "value" is one third of the turbulent intensity
scalarField value = 0.5*sqr(intensity_)*magSqr(Up);

// "stress" is a symmetric tensor field with diagonal elements equal to "value"
symmTensorField stress;

// I don't know how to set the values in the tensor
/*
 *          / value  0.0   0.0  \
 * stress = |  0.0  value  0.0  |
 *          \  0.0   0.0  value /
 */

operator==(stress);

fixedValueFvPatchSymmTensorField::updateCoeffs();
As you can see, it is transferring the scalarField values to the symmTensorField which I can't work out how to do. There are no existing derived tensor boundary conditions to copy off, so I'm stuck for ideas. If anyone could help, I'd be eternally grateful.

Many thanks, and apologies for reposting this. No-one replied to the last post I made, and I've had some time to re-formulate the question, hopefully a little more clearly.
maninthemail is offline   Reply With Quote

Old   September 29, 2011, 14:11
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Did you already try something like this:
Code:
symmTensorField stress(value,0,0,value,0,value);
I am not sure if it works like this, but otherwise you may want to try:
Code:
symmTensor I(1,0,0,1,0,1);
symmTensorField stress=value*I;
However, for both I am not sure if it works, but it may give you some directions, good luck!
Tushar@cfd likes this.
Bernhard is offline   Reply With Quote

Old   September 30, 2011, 04:13
Default
  #3
New Member
 
Bill
Join Date: Jun 2011
Location: UK
Posts: 14
Rep Power: 6
maninthemail is on a distinguished road
The second of those works. Thank you very much.
maninthemail is offline   Reply With Quote

Reply

Tags
boundary, condition, rstm, scalar, tensor

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems in creating a wedge type mesh Joscha OpenFOAM Native Meshers: blockMesh 22 May 14, 2015 05:10
Fluent3DMeshToFoam simvun OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 May 14, 2012 05:20
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
Problems with Meshing: Collapsed Cells Emmanuel Resch CD-adapco 1 July 30, 2007 03:02
Gerris software installation mer Main CFD Forum 2 November 12, 2005 09:50


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