
[Sponsors] 
June 19, 2012, 13:15 
swak4Foam for calculating velocity transformations

#1 
New Member
Santosh
Join Date: Nov 2009
Location: Netherlands
Posts: 16
Rep Power: 7 
Hi,
I am trying to calculate a new transformed velocity field as a post processing step according to the following expression: dU/dt = c*dUz/dx, where c is a constant. I am trying it using swak4Foam, in which I had a couple of questions,  how to add the dUz/dx term? I can add the div(U) term, but how to ensure that I get dUz/dx alone?  for the dU/dt term, is it possible to use an explicit formulation like, U=Udelta(T)*c*<term for dUz/dx>? I went through the slides on swak4Foam (No C++, please. We’re users!, Bernhard F.W. Gschaider, June 2011), and found multiple ways to obtain such expressions.  using libswakFunctionObject and expressionField kind formulations (slide number 61/176) Ustar { functionObjectLibs ("libswakFunctionObjects.so"); type expressionField; outputControl timeStep; fieldName Ustar; expression "U = U  c*div(U)*deltaT()"; autowrite true; }  using storedValues and patchExpression (slide 131/176) Which of the above will be apt for this formulation? Lastly, I was trying to compile swak4Foam for OpenFoam v. 2.0.1, and I get the following errors (related to swakcodedFunctionObject) while compiling: swakCodedFunctionObject.C:299: error: no matching function for call to ‘Foam::swakCodedFunctionObject::updateLibrary(Foam ::word&)’ /home/OpenFOAM/OpenFOAM2.0.1/src//postProcessing/functionObjects/utilities/lnInclude/codedFunctionObject.H:111: note: candidates are: void Foam::codedFunctionObject::updateLibrary() const make: *** [Make/linux64GccDPOpt/swakCodedFunctionObject.o] Error 1 I removed the last parameter to the =codedFunctionObject=constructor in =swakCodedFunctionObject.C= as mentioned in the README, but still continue to get this error. Due to this, I am unable to use the expressionField kind of formulation as well. Rest of the functions are compiled fine, the problem is only with the codedFunctionObject. Looking forward to some directions. Thanks, Santosh 

June 19, 2012, 15:58 

#2  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38 
Quote:
What speaks against "grad(U.z).x" ? Quote:
Quote:
If the solver doesn't store the old U a sequence like this (yeah. This is weird) in the variables Code:
"oldU=storedU;" "oldU=U;" Quote:


June 19, 2012, 17:26 

#3 
New Member
Santosh
Join Date: Nov 2009
Location: Netherlands
Posts: 16
Rep Power: 7 
thanks for the reply Bernhard, really appreciated.
So, if I understand correct, 1. If U is stored in the previous time step, then I can use the expressionField, with the following expression, Code:
expression "oldTime(U)  c*grad(U.z).x*deltaT()"; Code:
variables ( "oldU=storedU;" "oldU=U;" "storedU =oldU  deltaT()*c*grad(U.z).x;" ) storedVariables ( { name storedU; initialValue "0"; } ) expression "storedU" I will try upgrading my version of OpenFoam, and hope it works. Thanks again. Santosh 

June 20, 2012, 06:18 

#4  
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38 
Quote:
Concerning your variables: I think you'll want to exchange the last two assignments (overwrite oldU AFTER it was used. But I still don't quite understand what exactly you're trying to calculate here 

June 20, 2012, 06:39 

#5 
New Member
Santosh
Join Date: Nov 2009
Location: Netherlands
Posts: 16
Rep Power: 7 
I am trying to calculate a transformation which will lead to a new steady velocity field. The constant "c" in my expression is the velocity of structures I observe in the flow. After this transformation, I will be able to obtain a velocity field which does not change with time.


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Steady pipe flow mean velocity higher than inlet velocity  anita  OpenFOAM Running, Solving & CFD  7  September 25, 2012 06:35 
Plotting Radial Velocity and Tangential Velocity in CFD Post  ashtonJ  CFX  2  April 24, 2012 05:30 
ATTENTION! Reliability problems in CFX 5.7  Joseph  CFX  14  April 20, 2010 16:45 
Velocity in Porous medium : HELP! HELP! HELP!  Kali Sanjay  Phoenics  0  November 6, 2006 07:10 
what the result is negatif pressure at inlet  chong chee nan  FLUENT  0  December 29, 2001 06:13 