how to add an inlet expression using groovyc
1 Attachment(s)
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 |
it is so easy with groovyBC,
it should be something like this: Code:
type groovyBC; |
3 Attachment(s)
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 |
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::DimensionedField<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 |
1 Attachment(s)
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? |
I missed a parameter in my velocity and it was solved . :)
|
what exactly did u miss?
could you please share your case setup?? so that we can run and see the results |
Sure, I will.:)
Please send your email Kind regards. |
|
All times are GMT -4. The time now is 18:03. |