|
[Sponsors] |
[swak4Foam] how to add an inlet expression using groovyc |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 27, 2017, 03:04 |
how to add an inlet expression using groovyc
|
#1 |
Senior Member
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14 |
Attachment 58006Dear Foamers
I installed swak4foam but I have no idea how to insert my sinusoidal inlet velocity to my inlet boundary in my U file at0 folder. my velocity profile is u (y,t)= u(y,t)=2U(1-(y/D)**2)(1+0.2*sin(t)) my geometry is something like the attached file. Any help is greatly appreciated. BR, Mohsen Last edited by m5m5kh; August 29, 2017 at 10:35. |
|
August 27, 2017, 16:07 |
|
#2 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
it is so easy with groovyBC,
it should be something like this: Code:
type groovyBC; variables "Uinlet=1;D=1;" valueExpression "vector(2*Uinlet*(1-pow(pos().y/D,2))*(1+0.2*sin(time())))"
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
August 28, 2017, 15:02 |
|
#3 |
Senior Member
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14 |
Dear Nima
Thanks for your help.I do as you said for another case and geometry but something weired happened after using icoFoam. I attached my case file and I would be grateful if you update me with my mistakes. Kind Regards, Mohsen Last edited by m5m5kh; August 29, 2017 at 10:33. |
|
August 29, 2017, 02:51 |
|
#4 |
Senior Member
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14 |
mohsen@mohsen-SVE14122CVW:~/Desktop/dilate100p$ icoFoam
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 4.1 Exec : icoFoam Date : Aug 29 2017 Time : 18:00:02 Host : "mohsen-SVE14122CVW" PID : 20522 Case : /home/mohsen/Desktop/dilate100p nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PISO: Operating solver in PISO mode Reading transportProperties Reading field p Reading field U --> FOAM FATAL IO ERROR: Unknown patchField type groovyBC for patch type patch Valid patchField types are : 76 ( SRFFreestreamVelocity SRFVelocity SRFWallVelocity activeBaffleVelocity activePressureForceBaffleVelocity advective calculated codedFixedValue codedMixed cyclic cyclicACMI cyclicAMI cyclicSlip cylindricalInletVelocity directionMixed empty externalCoupled extrapolatedCalculated fixedGradient fixedInternalValue fixedJump fixedJumpAMI fixedMean fixedNormalInletOutletVelocity fixedNormalSlip fixedProfile fixedValue flowRateInletVelocity fluxCorrectedVelocity freestream inletOutlet interstitialInletVelocity mapped mappedField mappedFixedInternalValue mappedFixedPushedInternalValue mappedFlowRate mappedVelocityFlux mixed movingWallVelocity noSlip nonuniformTransformCyclic outletInlet outletMappedUniformInlet outletPhaseMeanVelocity partialSlip pressureDirectedInletOutletVelocity pressureDirectedInletVelocity pressureInletOutletParSlipVelocity pressureInletOutletVelocity pressureInletUniformVelocity pressureInletVelocity pressureNormalInletOutletVelocity processor processorCyclic rotatingPressureInletOutletVelocity rotatingWallVelocity sliced slip supersonicFreestream surfaceNormalFixedValue swirlFlowRateInletVelocity symmetry symmetryPlane timeVaryingMappedFixedValue translatingWallVelocity turbulentInlet uniformFixedGradient uniformFixedValue uniformInletOutlet uniformJump uniformJumpAMI variableHeightFlowRateInletVelocity waveTransmissive wedge zeroGradient ) file: /home/mohsen/Desktop/dilate100p/0/U.boundaryField.inlet from line 30 to line 37. From function static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New(const Foam::fvPatch&, const Foam:imensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = Foam::Vector<double>] in file /home/ubuntu/OpenFOAM/OpenFOAM-4.1/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 134. FOAM exiting My OpenFOAM version is 4.1 Last edited by m5m5kh; August 29, 2017 at 10:54. |
|
August 30, 2017, 04:08 |
|
#5 |
Senior Member
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14 |
I reinstalled groovyBC again and changed my valueExpression and the problem seems to be solved.
-------------------------------------------------------------------------------------------------- inlet { type groovyBC; variables "Uinlet=0.3;D=1;u=6*Uinlet*(pos().y/D)*(1-(pos().y))*(1+(0.1*sin(time())));"; valueExpression "vector(u,0,0)"; } --------------------------------------------------------------------------------------------------- but there is a problem while the flow enters the domain from upper corner of inlet.however it should enters the domain from the middle of channel. see the enclosed picture. How can I correct this? |
|
September 2, 2017, 03:06 |
|
#6 |
Senior Member
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14 |
I missed a parameter in my velocity and it was solved .
|
|
September 2, 2017, 14:32 |
|
#7 |
Senior Member
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10 |
what exactly did u miss?
could you please share your case setup?? so that we can run and see the results |
|
September 3, 2017, 08:41 |
|
#8 |
Senior Member
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14 |
Sure, I will.
Please send your email Kind regards. |
|
May 17, 2021, 11:44 |
|
#9 |
New Member
Join Date: May 2021
Posts: 6
Rep Power: 5 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlet boundary condition in interFoam | Andrea_85 | OpenFOAM Running, Solving & CFD | 51 | July 20, 2017 14:31 |
Problem with assigned inlet velocity profile as a boundary condition | Ozgur_ | FLUENT | 5 | August 25, 2015 05:58 |
TimeVaryingMappedFixedValue for Direct Numerical Simulation inlet | johndeas | OpenFOAM | 5 | May 21, 2014 08:11 |
How to set up the inlet boundary condition for a low pressure case? | beastieboys6 | FLUENT | 3 | April 10, 2012 23:46 |
ATTENTION! Reliability problems in CFX 5.7 | Joseph | CFX | 14 | April 20, 2010 16:45 |