CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   New boundary condition (https://www.cfd-online.com/Forums/openfoam-solving/60325-new-boundary-condition.html)

Kanarya February 28, 2012 06:54

particleSlipJohnsonJackson
 
hi Alex,

I don not have in the case folder but I added in the system/controlDict file like:

libs ("libJohnsonJackson.so");

makaveli_lcf February 28, 2012 06:55

To solve it the solver which you use should read kineticTheoryProperties file, as it reads for example transportProperties file.
Check twoPhaseEulerFoam solver if it reads kineticTheoryProperties, and if not add reading of kineticTheoryPropertie.

makaveli_lcf February 28, 2012 07:00

No, you miss-understood:
Do you have constant/kineticTheoryProperties file in your case folder?

Kanarya February 28, 2012 07:03

particleSlipJohnsonJackson
 
yes I have it in bad2/constant/kineticTheoryProperties

makaveli_lcf February 28, 2012 07:04

so, then check if twoPhaseEulerFoam reads it?

Kanarya February 28, 2012 07:08

particleSlipJohnsonJackson
 
I have really stuid question is there any way to check it or I should just change the variable there and it is reading when I am using classical BC like noSlip

makaveli_lcf February 28, 2012 07:15

stupid answer: "look to the source code of twoPhaseEulerFoam")))

Kanarya February 28, 2012 07:34

nice answer :) there is kinetictheoryModels only included and they are connected to the kineticTheoryProperties file

Kanarya February 28, 2012 07:47

particleSlipJohnsonJackson
 
normal tutorial case(case bed2 and solver twoPhaseEulerFoam) it is running so it means it reading the kineticTheoryProperties file:

{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

phasea
{
rho rho [ 1 -3 0 0 0 ] 2500;
nu nu [ 0 2 -1 0 0 ] 1e-06;
d d [ 0 1 0 0 0 0 0 ] 0.0003;
}

phaseb
{
rho rho [ 1 -3 0 0 0 ] 1.2;
nu nu [ 0 2 -1 0 0 ] 1.5e-05;
d d [ 0 1 0 0 0 0 0 ] 1;
}

Cvm Cvm [ 0 0 0 0 0 ] 0;

Cl Cl [ 0 0 0 0 0 ] 0;

Ct Ct [ 0 0 0 0 0 ] 0;

alphaAlpha alphaAlpha [ 0 0 0 0 0 ] 0;

it seems everything is ok but actually not :(

Kanarya February 28, 2012 07:49

this is kineticTheoryProperties :
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object kineticTheoryProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

kineticTheory on;

equilibrium on;

e e [ 0 0 0 0 0 0 0 ] 0.8;

alphaMax alphaMax [ 0 0 0 0 0 0 0 ] 0.62;

alphaMinFriction alphaMinFriction [ 0 0 0 0 0 0 0 ] 0.65;

Fr Fr [ 1 -1 -2 0 0 0 0 ] 0.05;

eta eta [ 0 0 0 0 0 0 0 ] 2;

p p [ 0 0 0 0 0 0 0 ] 5;

phi phi [ 0 0 0 0 0 0 0 ] 0;

viscosityModel Gidaspow;

conductivityModel Gidaspow;

granularPressureModel Lun;

frictionalStressModel JohnsonJackson;

radialModel Gidaspow;

HrenyaSinclairCoeffs
{
L L [ 0 1 0 0 0 0 0 ] 0.0005;
}

makaveli_lcf February 28, 2012 08:01

Ok, it seems that it is the problem. BC looks alphaMax in kinetic dictionary and it is renamed to transportProperties or something similar.

Quote:

// Update the coefficients associated with the patch field
void particleSlipJohnsonJacksonFvPatchVectorField::upda teCoeffs()
{
if (updated())
{
return;
}

if ((specularityCoefficient_ < 0) || (specularityCoefficient_ > 1))
{
FatalErrorIn
(
"particleSlipJohnsonJacksonFvPatchScalarField: :"
"updateCoeffs()"
) << "The value of the specularity coefficient has to be between 0 and 1."
<< abort(FatalError);
}

const dictionary& transportProperties = db().lookupObject<IOdictionary>
(
"transportProperties"
);

// const dictionary& kineticTheoryProperties = db().lookupObject<IOdictionary> ("kineticTheoryProperties");

dictionary phaseaDictionary
(
transportProperties.subDict("phasea")
);

dimensionedScalar rhoa(phaseaDictionary.lookup("rho"));
// dimensionedScalar alphaMax(kineticTheoryProperties.lookup("alphaMax" ));
dimensionedScalar alphaMax(transportProperties.lookup("alphaMax"));


const fvPatchScalarField& alpha =
patch().lookupPatchField<volScalarField, scalar>("alpha");

const fvPatchScalarField& g0 =
patch().lookupPatchField<volScalarField, scalar>("gs0");

const fvPatchScalarField& mua =
patch().lookupPatchField<volScalarField, scalar>("mua");

scalarField alphaPatch = alpha.patchInternalField() + 1.0e-6;
scalarField ThetaPatch = max(alphaPatch, 1.0e-6);
scalarField g0Patch = g0.patchInternalField();
scalarField muaPatch = mua.patchInternalField();

if (db().foundObject<volScalarField>("Theta"))
{
const fvPatchScalarField& Theta =
patch().lookupPatchField<volScalarField, scalar>("Theta");

ThetaPatch = Theta.patchInternalField();
}

// The partial slip BC in OpenFOAM is implemented as
//
// valueFraction*U + (1-valueFraction)*grad(U) = 0
//
// To find valueFraction, we re-write Johnson and Jackson BC as
//
// c*U + grad(U) = 0
//
// where
//
// c = valueFraction/(1 - valueFraction)
//
// As a consequence
//
// valueFraction = 1/(c + 1)

scalarField c = (6.0*muaPatch*alphaMax.value())/
(M_PI*rhoa.value()*alphaPatch*g0Patch*
specularityCoefficient_*sqrt(3.0*ThetaPatch));

this->valueFraction() = scalar(1)/(c + scalar(1));

partialSlipFvPatchVectorField::updateCoeffs();
}
Try updates in particleSlipJohnsonJacksonFvPatchVectorField.C which I marked with bold, recompile library and try again to run a solver.

Kanarya February 28, 2012 08:52

particleSlipJohnsonJackson
 
hi Alex,

I got the same error...:( again. this boundary conditions are made by Alberto and Juho..

best!
P.S: while compiling I got some message "statement has no effect":
SOURCE=particleSlipJohnsonJackson/particleSlipJohnsonJacksonFvPatchVectorField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam210/src/triSurface/lnInclude -I/opt/openfoam210/src/meshTools/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/particleSlipJohnsonJacksonFvPatchVectorField.o
particleSlipJohnsonJackson/particleSlipJohnsonJacksonFvPatchVectorField.C: In member function ‘virtual void Foam::particleSlipJohnsonJacksonFvPatchVectorField ::updateCoeffs()’:
particleSlipJohnsonJackson/particleSlipJohnsonJacksonFvPatchVectorField.C:125 :6: warning: statement has no effect [-Wunused-value]
'/opt/openfoam210/platforms/linux64GccDPOpt/lib/libJohnsonJackson.so' is up to date.
Recep

Kanarya February 28, 2012 11:52

OpenFoam for Multiphase Solid-Gas Model
 
hi Alex
anything else you can suggest because it is really important for me to have kind of BC

thanks a lot for your help

makaveli_lcf February 28, 2012 12:46

I think you make some thing not exactly the same way I told you. Please upload here archived library folder (source files and Make directory), archived case folder you use and clarify which solver in which OF version you are trying to use. Tomorrow I will check it myself. Too busy now with my project.

Cheers!

Kanarya February 28, 2012 13:02

particleSlipJohnsonJackson
 
Hi Alex,

Sorry for disturbing you. Thanks a lot...I am using version of OpenFoam210 and solver twoPhaseEulerFoam. I will send the case and particleSlipJohnsonJackson BC file as well in your email address because they are too big for here.

Thanks a lot and sorry again!!!

Best!

Recep

Lindemann1712 March 20, 2012 01:42

SpoutBed with here presented BC's
 
Hello,

I'm new at OpenFOAM and I've tried to simulate the spoutBed presented by Buijtenen. "Numerical and experimental study on multiple-spout fluidized beds"

After adapting the twoPhaseEulerFoam solver (defining a mapping field in which region the velocity of granular phase and temperature should be solved, otherwise the bed collapses allways in OF 1.7.1) and using fixedValue (0 0 0) at the wall for the granular phase I got nice and useable results, but with zero velocity at the wall.

I want to improve them by adding the boundary conditions of Schneiderbauer et. al.
("CFD study of a single-spout pseudo-2D bed: the impact of solids wall boundary conditions", 2012)
and for comparison Johnson and Joackson with spec. coeff = 0.15. Schneiderbauer et. al. BC's have the benefit that the BC's only use material parameters and are more accurate as Johnson and Jackson BC's with adaptive Specularity Coefficient calculation.

So I saw the discussion here and used the way presented by alberto and started with partialSlip boundary Condition

valueFraction*U + (1-valueFraction)*gradU*delta n = 0

The results of both BC's were nearly identically, but I also had in my bed allways velocity zero (or nearly zero) at the wall. This isn't the case in reality and measurements shown in the paper, also our CFDEM results show other tendencies, so for my opinion this useage is maybe mathematical correct, but not physically and we need physically correct results, but it give the best result for this simulation I have got now.

Now i'm searching for other ideas to implement the two boundary conditions in OpenFOAM.

For example with a mixedBoundary condition

valueFraction*(U-Uref)+ (1-valueFraction)*(gradU*delta n-gradUref*delta n) = 0,

or a calculated one. Does anybody has some knowledge about calculated boundary conditions and how the work?

makaveli_lcf March 20, 2012 02:44

David, your question is too general. There are a lot of discussions here about different BC implementations. You can create your own copying e.g. mixed typed BC from OpenFOAM and update it according to your formulation. You just have to know how your BC influences diagonal and source parts of the matrix. Another opportunity is to use swak4foam... So choice is yours...

Regarding calculated BC: boundary values are obtained from field calculations, e.g. if Field_c = Field_a <operation > Field_b, boundary values for Field_c are already calculated from previous relation and are not updated in some special way.

Lindemann1712 March 20, 2012 02:50

Thank you for the quick answer. I will have a look at swak4foam.

Kanarya March 26, 2012 10:14

particleSlipJohnsonJackson
 
Hi,

I am implemeting JohnsonJackson BC , I have some problems:

walls
{
type particleThetaJohnsonJackson;
specularityCoefficient 0.5;
}

Is it correct to write like this?

thanks ...

Best!

Recep

Lindemann1712 March 27, 2012 03:35

Don't forget
 
to inlcude the value !!

walls
{
type particleSlipJohnsonJackson;
specularityCoefficient 0.5;
value uniform(0 0 0);
}

I think, this was already discussed here in the CFD-online forum.

regards,
David


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