CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] how to add an inlet expression using groovyc

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 27, 2017, 02:04
Default how to add an inlet expression using groovyc
  #1
Senior Member
 
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14
m5m5kh is on a distinguished road
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
Attached Images
File Type: png Screenshot from 2017-08-27 10-30-58.png (11.8 KB, 39 views)

Last edited by m5m5kh; August 29, 2017 at 09:35.
m5m5kh is offline   Reply With Quote

Old   August 27, 2017, 15:07
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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())))"
warning: i did not check.
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   August 28, 2017, 14:02
Default
  #3
Senior Member
 
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14
m5m5kh is on a distinguished road
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
Attached Images
File Type: png Screenshot from 2017-08-28 22-16-15.png (17.4 KB, 31 views)
Attached Files
File Type: gz 0.tar.gz (691 Bytes, 12 views)
File Type: gz system.tar.gz (993 Bytes, 6 views)

Last edited by m5m5kh; August 29, 2017 at 09:33.
m5m5kh is offline   Reply With Quote

Old   August 29, 2017, 01:51
Default
  #4
Senior Member
 
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14
m5m5kh is on a distinguished road
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 09:54.
m5m5kh is offline   Reply With Quote

Old   August 30, 2017, 03:08
Default
  #5
Senior Member
 
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14
m5m5kh is on a distinguished road
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?
Attached Images
File Type: png 1.png (11.3 KB, 28 views)
m5m5kh is offline   Reply With Quote

Old   September 2, 2017, 02:06
Default
  #6
Senior Member
 
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14
m5m5kh is on a distinguished road
I missed a parameter in my velocity and it was solved .
m5m5kh is offline   Reply With Quote

Old   September 2, 2017, 13:32
Default
  #7
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10
saddy is on a distinguished road
what exactly did u miss?
could you please share your case setup??
so that we can run and see the results
saddy is offline   Reply With Quote

Old   September 3, 2017, 07:41
Default
  #8
Senior Member
 
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14
m5m5kh is on a distinguished road
Sure, I will.
Please send your email

Kind regards.
m5m5kh is offline   Reply With Quote

Old   May 17, 2021, 10:44
Default
  #9
New Member
 
Join Date: May 2021
Posts: 6
Rep Power: 5
Banbor is on a distinguished road
thankyou

banbor2018@hotmail.com
Banbor 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
Outlet boundary condition in interFoam Andrea_85 OpenFOAM Running, Solving & CFD 51 July 20, 2017 13:31
Problem with assigned inlet velocity profile as a boundary condition Ozgur_ FLUENT 5 August 25, 2015 04:58
TimeVaryingMappedFixedValue for Direct Numerical Simulation inlet johndeas OpenFOAM 5 May 21, 2014 07:11
How to set up the inlet boundary condition for a low pressure case? beastieboys6 FLUENT 3 April 10, 2012 22:46
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45


All times are GMT -4. The time now is 08:32.