Accessing the value of a field variable
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 |
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?
|
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? |
U
only "U" Info << U << endl; |
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. |
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 |
1 Attachment(s)
Quote:
Thanks. |
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, |
All times are GMT -4. The time now is 18:19. |