CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] a Problem with groovyBC for icoFoam (https://www.cfd-online.com/Forums/openfoam-community-contributions/192155-problem-groovybc-icofoam.html)

m5m5kh August 29, 2017 12:42

a Problem with groovyBC for icoFoam
 
Dear Foamers

I use OF v4.1. I installed the swak4foam.

my geometry is a 2D channel with a pulsatile inlet velocity which behaves as below:

u (y,t)= u(y,t)=2U(1-(y/D)**2)(1+0.2*sin(t)) where U=2 m/s and D = 1 m.

my U file is as follows:
---------------------------------------------------------------------------------------------------------------------------
dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
outlet
{
type zeroGradient;
}

inlet
{
type groovyBC; //
variables "Uinlet=1 ;D=1;"
valueExpression "vector(2*Uinlet*(1-pow((pos().y)/D,2))*(1+0.2*sin(time())))";
}

upperWall
{
type noSlip;
}

lowerWall
{
type noSlip;
}

frontAndBackPlanes
{
type empty;
}
}
---------------------------------------------------------------------------------------------------------------------------

my P file is:

---------------------------------------------------------------------------------------------------------------------------
dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
outlet
{
type fixedValue;
value uniform 0;
}

inlet
{
type zeroGradient;
}

upperWall
{
type zeroGradient;
}

lowerWall
{
type zeroGradient;
}

frontAndBackPlanes
{
type empty;
}
}

---------------------------------------------------------------------------------------------------------------------------

my controlDict is:

---------------------------------------------------------------------------------------------------------------------------

application icoFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 10;

deltaT 0.0001;

writeControl timeStep;

writeInterval 500;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;


libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
);
----------------------------------------------------------------------------------------------------------------------------
following error occurred after runing icoFoam in terminal


mohsen@mohsen-SVE14122CVW:~/OpenFOAM/mohsen-4.1/run/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 : 21:08:56
Host : "mohsen-SVE14122CVW"
PID : 3268
Case : /home/mohsen/OpenFOAM/mohsen-4.1/run/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 Warning :
From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(c onst fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
in file groovyBCFvPatchField.C at line 131
No value defined for U on inlet therefore using the internal field next to the patch
Reading/calculating face flux field phi


Starting time loop

Time = 0.0001

Courant Number mean: 0 max: 0
smoothSolver: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG: Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
DICPCG: Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
ExecutionTime = 0.18 s ClockTime = 0 s

Time = 0.0002

Courant Number mean: 0 max: 0
smoothSolver: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG: Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
DICPCG: Solving for p, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
ExecutionTime = 0.19 s ClockTime = 0 s

------------------------------------------------------------------------------------------------------------------
And this happens for all time steps. I do not know where the mistake is.
If anyone experienced a similar problem I would be happy to have advices.

Kind regards.

m5m5kh August 29, 2017 15:57

I am looking forward to urgent help of some professional foamers . :D


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