|
[Sponsors] |
March 20, 2024, 11:20 |
codedFixedValue
|
#1 |
New Member
Karol Celinski
Join Date: Feb 2024
Location: UK
Posts: 13
Rep Power: 2 |
Hi all,
I am trying to use: U { internalField uniform (0 0 2.5); boundaryField { inlet { type codedFixedValue; value uniform (0 0 1); name parabolicVelocity; code #{ const vectorField& Cf = patch().Cf; vectorField& field = *this; const scalar R = 69 const scalar Vav = 2.5; forAll(Cf, faceI) { const scalar x = Cf[faceI][0] const scalar y = Cf[faceI][1] field[faceI] = vector(0,0,2*Vav*(1-(pow(((pow(pow(x,2+pow(y,2),0.5))/R),2)) } #}; } but I am getting an error Could not load "/alice-home/1/k/kac24/cavity_but_bendy/bubbler_18mar/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libparabolicVelocity_0dd38b0724eb3f538f626fd383ecd a3f8f71b9cd.so" I could not see any documentation anywhere. The tutorial (yt) I based my code on is for version openfoam .org. Does anyone have any working codedFixedValue script for version v2306 or similar that I could use as a template? Thanks in advance |
|
April 23, 2024, 19:00 |
|
#2 | |
New Member
Felipe Noh
Join Date: Aug 2014
Posts: 8
Rep Power: 12 |
Quote:
This works perfectly in OpenFOAM 11. inlet { type codedFixedValue; value uniform (0 0 0); name parabolicU; // user-defined name code #{ const fvPatch& boundaryPatch = this->patch(); const vectorField& Cf = boundaryPatch.Cf(); vectorField& v = *this; scalar Uc = 0.264075; // centerline velocity, U_average scalar R = 0.04; // inlet radius forAll(Cf,faceI) { scalar z = Cf[faceI].z(), y = Cf[faceI].y(), rSq = z*z + y*y; v[faceI] = vector(2*Uc*(1 - rSq/(R*R)),0, 0); } #}; I hope you find it useful. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
including parameter file in codedFixedValue | Loekatoni | OpenFOAM Running, Solving & CFD | 4 | November 9, 2023 17:56 |
Syntax of codedFixedValue | trailer | OpenFOAM Running, Solving & CFD | 1 | July 24, 2021 07:17 |
[sedFoam] codedFixedValue does not transport alpha fields | victor13165 | OpenFOAM Running, Solving & CFD | 0 | July 13, 2021 10:30 |
codedFixedValue: accessing other patch causes crash in parallel | RL-S | OpenFOAM Running, Solving & CFD | 2 | December 24, 2019 22:20 |
Using codedFixedvalue to apply totalPressure Boundary Condition | cdm | OpenFOAM Running, Solving & CFD | 2 | June 22, 2013 15:10 |