|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Will
Join Date: Jun 2011
Location: UK
Posts: 13
Rep Power: 3 ![]() |
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(); 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. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 513
Rep Power: 9 ![]() |
Did you already try something like this:
Code:
symmTensorField stress(value,0,0,value,0,value); Code:
symmTensor I(1,0,0,1,0,1); symmTensorField stress=value*I; |
|
|
|
|
|
|
|
|
#3 |
|
New Member
Will
Join Date: Jun 2011
Location: UK
Posts: 13
Rep Power: 3 ![]() |
The second of those works. Thank you very much.
|
|
|
|
|
|
![]() |
| Tags |
| boundary, condition, rstm, scalar, tensor |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems in creating a wedge type mesh | Joscha | OpenFOAM Native Meshers: blockMesh | 13 | April 2, 2013 05:49 |
| 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 08:50 |