CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

codedFixedValue velocity profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 20, 2015, 08:39
Default codedFixedValue velocity profile
  #1
Member
 
Join Date: Nov 2014
Posts: 36
Rep Power: 11
Tscar is on a distinguished road
Hi,

I am trying to make velocity profile on inlet according to the followind expression:
u_z = -0.25 * (1/*mu) * dpl * [ ( ln(r/r1) / ln(r2/r1) ) * (r2*r2 - r1*r1) - (r*r - r1*r1) ]

r is radial distance from the center of global coordinate system and it is r*r = x*x + y*y

inlet
{
type codedFixedValue;
value $internalField;
redirectType velocityProfile;

code
#{
scalar mu=1.87e-5;
scalar dpl=50;
scalar r1=2e-3;
scalar r2=4e-3;
fixedValueFvPatchVectorField myPatch(*this);
forAll(this->patch().Cf(),i)
{
myPatch[i]=vector(0,0, -0.25*(1/mu)*dpl* ((((Foam::log(Foam::sqrt(Foam:ow(this->patch().Cf()[i].x(), 2) + Foam:ow(this->patch().Cf()[i].y(), 2)) / r1)) / Foam::log(r2/r1))) * (r2*r2 - r1*r1) - (Foam:ow(this->patch().Cf()[i].x(), 2) + Foam:ow(this->patch().Cf()[i].x(), 2) - r1*r1) ) );
}
operator==(myPatch);
#};
}

I checked the coded expression many times and I did not find any mistake. Yet the computed velocity profile is not right. Can you please help me?
Tscar is offline   Reply With Quote

Old   December 22, 2015, 04:05
Default
  #2
Member
 
Join Date: Nov 2014
Posts: 36
Rep Power: 11
Tscar is on a distinguished road
And now I am embarased. There should be

(Foamw(this->patch().Cf()[i].x(), 2) + Foamw(this->patch().Cf()[i].y(), 2) - r1*r1) ) );

Problem solved.
Tscar is offline   Reply With Quote

Old   March 12, 2018, 02:47
Default Probem with temperature profile
  #3
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 8
gouravjee is on a distinguished road
Quote:
Originally Posted by Tscar View Post
Hi,

I am trying to make velocity profile on inlet according to the followind expression:
u_z = -0.25 * (1/*mu) * dpl * [ ( ln(r/r1) / ln(r2/r1) ) * (r2*r2 - r1*r1) - (r*r - r1*r1) ]

r is radial distance from the center of global coordinate system and it is r*r = x*x + y*y

inlet
{
type codedFixedValue;
value $internalField;
redirectType velocityProfile;

code
#{
scalar mu=1.87e-5;
scalar dpl=50;
scalar r1=2e-3;
scalar r2=4e-3;
fixedValueFvPatchVectorField myPatch(*this);
forAll(this->patch().Cf(),i)
{
myPatch[i]=vector(0,0, -0.25*(1/mu)*dpl* ((((Foam::log(Foam::sqrt(Foam:ow(this->patch().Cf()[i].x(), 2) + Foam:ow(this->patch().Cf()[i].y(), 2)) / r1)) / Foam::log(r2/r1))) * (r2*r2 - r1*r1) - (Foam:ow(this->patch().Cf()[i].x(), 2) + Foam:ow(this->patch().Cf()[i].x(), 2) - r1*r1) ) );
}
operator==(myPatch);
#};
}

I checked the coded expression many times and I did not find any mistake. Yet the computed velocity profile is not right. Can you please help me?
hello,
i have been working on a solidification/melting problem in which i am supposed to give a gaussian profile as a input heat flux i have written a code for that.but it is not giving me desired profile.
can you tell me where is the problem??
[CODE]
input
{
type codedFixedValue;
value uniform 573;
redirectType temperatureProfile;

code
#{

fixedValueFvPatchScalarField myPatch(*this);
forAll(this->patch().Cf(),i)
{
myPatch[i]=2076000*exp(-Foam:ow((this->patch().Cf()[i].x()-122.5)/6.067,2));
}
operator==(myPatch);
#};
}

[\CODE]
gouravjee is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[UDF] Relative coordinates in logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 25 July 13, 2017 03:44
3d velocity profile at velocity inlet swethaprakash FLUENT 3 September 1, 2015 02:10
Logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 19:09
[boundary condition] logarithmic velocity profile cfdworker FLUENT 2 April 17, 2009 23:36
Prescribed inflow velocity profile - how to? Alan Main CFD Forum 10 October 28, 2005 12:14


All times are GMT -4. The time now is 17:43.