|
[Sponsors] |
Setting specific values to a vector field component |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 30, 2015, 11:07 |
Setting specific values to a vector field component
|
#1 |
New Member
...
Join Date: Jun 2013
Posts: 19
Rep Power: 12 |
Hello to everyone,
As a beginner in OpenFOAM, I have a problem in compiling a modified version of a standard solver. Specifically, I have created a "volVectorField" in the respective "CreateFields.H" file, which is actually a velocity field. My problem is that I can't set the "Uy" component of this vector to a value that comes from a scalar variable Vcalc, which is calculated before. In other words I would like to set Code:
Uy = Vcalc I tried to find similar topics in the forum but I couldn't (or at least I didn't realize it!). Any help would be very appreciated. Best regards. |
|
October 1, 2015, 15:40 |
|
#2 |
New Member
James Montague
Join Date: Jan 2014
Location: Vermont, United States
Posts: 7
Rep Power: 12 |
When constructing your vector field you can construct a temporary volVectorField and multiply it by your scalar or scalarField. This would be done in the solver file E.G. icoFoam.c Vcalc must have the same dimensions as myU since your temp variable will be dimensionless.
In createFields.H you will have to initialize myU following the same convention as the other variables. You will also have to supply myU to the '0' folder with appropriate boundary conditions. Code:
volVectorField temp ( IOobject ( "temp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, vector(0,1,0) ); myU = temp*Vcalc; Jim |
|
October 9, 2015, 13:03 |
|
#3 |
New Member
...
Join Date: Jun 2013
Posts: 19
Rep Power: 12 |
Thank you James. It helped a lot!
Best regards |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTENTION! Reliability problems in CFX 5.7 | Joseph | CFX | 14 | April 20, 2010 15:45 |
Two-Phase Buoyant Flow Issue | Miguel Baritto | CFX | 4 | August 31, 2006 12:02 |
Printing Values on a Specific Surface | Matthew | FLUENT | 1 | February 8, 2006 08:15 |
Setting pressure value for specific cells, UDF | Amir | FLUENT | 2 | September 1, 2005 18:59 |
setting a volumetric flow rate at a specific place | Rage | CFX | 0 | July 25, 2003 16:07 |