|
[Sponsors] |
December 20, 2015, 09:39 |
codedFixedValue velocity profile
|
#1 |
Member
Join Date: Nov 2014
Posts: 36
Rep Power: 11 |
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? |
|
December 22, 2015, 05:05 |
|
#2 |
Member
Join Date: Nov 2014
Posts: 36
Rep Power: 11 |
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. |
|
March 12, 2018, 03:47 |
Probem with temperature profile
|
#3 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
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] |
||
|
|
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 04:44 |
3d velocity profile at velocity inlet | swethaprakash | FLUENT | 3 | September 1, 2015 03:10 |
Logarithmic velocity profile | cfdworker | Fluent UDF and Scheme Programming | 0 | April 23, 2009 20:09 |
[boundary condition] logarithmic velocity profile | cfdworker | FLUENT | 2 | April 18, 2009 00:36 |
Prescribed inflow velocity profile - how to? | Alan | Main CFD Forum | 10 | October 28, 2005 13:14 |