|
[Sponsors] |
June 23, 2018, 11:01 |
Accessing the value of a field variable
|
#1 |
Member
Join Date: Feb 2018
Posts: 91
Rep Power: 8 |
Hello,
I have looked at the forums and have found solutions but I want to be sure that I am correct. I am trying to access the value of velocity during each time step to calculate losses in a ventilation duct. Here is the form that I have written it in: Code:
const volVectorField& Uduct = U.db().lookupObject<volVectorField>("U"); Thanks |
|
June 23, 2018, 16:15 |
|
#2 |
Member
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 13 |
Your questions is difficult to understand. From where do you need to access the velocity? In a boundary condition? In the solver itself? In a post-processing tool?
|
|
June 25, 2018, 08:15 |
|
#3 |
Member
Join Date: Feb 2018
Posts: 91
Rep Power: 8 |
HI thanks,
From the solver itself. So what ever value of U in the time step, it looks it up and gets the value. Is that possible? |
|
June 25, 2018, 08:26 |
|
#4 |
Member
Norbert Weber
Join Date: May 2012
Location: Dresden, Germany
Posts: 37
Rep Power: 13 |
U
only "U" Info << U << endl; |
|
June 25, 2018, 15:06 |
|
#5 |
Member
Join Date: Feb 2018
Posts: 91
Rep Power: 8 |
Alright thanks.
Is it possible to use the values at each time step to update the values for the reynolds number. I need the value for the reynolds number to calculate the flow loss. I assumed my earlier code would do that but at the moment all I think it does is take the initial velocity value. Thanks. |
|
June 25, 2018, 17:07 |
|
#6 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,684
Rep Power: 40 |
Quote:
If we really start with this: Code:
const volVectorField& Uduct = U.db().lookupObject<volVectorField>("U"); If you want to calculate a Reynolds number or something, having the entire velocity field throughout the volume probably won't help much. It might be more useful to use a sampling plane or a sampling patch combined with an area average to obtain a representative value. Can't say offhand where you want to proceed from there (how to get a length scale, which rho, mu, etc) - it's not really obvious from your post what data or geometry you have. /mark |
||
June 26, 2018, 06:45 |
|
#7 | |
Member
Join Date: Feb 2018
Posts: 91
Rep Power: 8 |
Quote:
Thanks. |
||
June 17, 2020, 16:36 |
|
#8 |
Senior Member
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 6 |
What would be the code line to access to the variable field 'k', let say at every cells center of the domain, but from the file fvOptions?
I try to find an example of how to achieve that and I find nothing. Thank! Best Regards, |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] dynamicTopoFVMesh and pointDisplacement | RandomUser | OpenFOAM Meshing & Mesh Conversion | 6 | April 26, 2018 07:30 |
Compare field variable in two cells | upuli | OpenFOAM Programming & Development | 0 | July 24, 2017 01:06 |
Help solving "c dot inv(A)" after solving the field variable (Ax=b) | Logan Page | OpenFOAM Programming & Development | 0 | September 11, 2014 07:57 |
field function to point variable temperature | Trofrensis | STAR-CCM+ | 1 | November 25, 2009 00:46 |
field variable macro of the mean-x-velocity? | zt xie | FLUENT | 2 | November 15, 2005 05:48 |