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] groovyBC and funkySetFields married and got a kid named swak4Foam (https://www.cfd-online.com/Forums/openfoam-community-contributions/80048-groovybc-funkysetfields-married-got-kid-named-swak4foam.html)

akidess March 29, 2014 09:25

Unfortunately I didn't keep the logfile, but I think it broke when compiling swak4FoamParsers which allows for three cores. The CPU I compiled this on was a Intel Xeon E5-2650L 0 @ 1.80GHz.

wyldckat March 30, 2014 08:04

Thanks! I've reported this here: https://sourceforge.net/apps/mantisb...iew.php?id=214 - and I'll try to figure out a way to fix this, as I really do like being able to build swak4Foam with multiple cores!

vasava December 18, 2014 06:38

Monitor mass flow for individual phase through outlet
 
I am using openFoam 2.3.0 and running a case which has 4 phases with multiphaseEulerFoam. Is is possible to monitor mass flow rate for all four individual phases using swak4Foam? Could someone post a code that help me get started with this?

gschaider January 7, 2015 16:23

Quote:

Originally Posted by vasava (Post 524499)
I am using openFoam 2.3.0 and running a case which has 4 phases with multiphaseEulerFoam. Is is possible to monitor mass flow rate for all four individual phases using swak4Foam? Could someone post a code that help me get started with this?

Yes it is possible.

Have you already had a look at one of the available presentations about swak?

The only tricky part would be that the new solvers have names for the phases like alpha.air and the dot bothers the parser. You'll have to add an aliases dictionary like
Code:

aliases {
  alphaAir alpha.air;
}

and then you can use a swakExpression like "phi()*alphaAir"

vasava January 13, 2015 02:52

Thanks for the reply. I will look if I have that presentation if not I will ask for it.

HappyS5 July 5, 2019 17:34

Can someone be more specific when defining the variables and expression?
 
Quote:

Code:
inlet
{
type groovyBC;
variables "rpm=8000.0;Un=55.8;c=sum(pos()*mag(Sf()))/sum(mag(Sf()));n=sum(normal())/mag(sum(normal()));p=pos()-c;r=mag(p)+1.0e-10;R=max(r);xt=vector(n.y,-n.x,0);xT=xt/mag(xt);yt=vector(-n.x*n.z,-n.y*n.z,n.x*n.x+n.y*n.y);yT=yt/mag(yt);";
valueExpression "-Un*normal() + (rpm*pi/30)*((p & yT)*xT - (p & xT)*yT)";

c is the centre of the patch, n is the averaged patch normal.
}

Quote:

Originally Posted by gschaider (Post 404966)
The usage example of the swirl was not added by my to the page: http://openfoamwiki.net/index.php?ti...730&oldid=9729

If I interpret Niklas' equations correctly he assumes that the swirl-axis is the Z-axis (and in your case it is Y if I understand you correctly). Use your mathematical common sense to reformulate it (& is the inner product of vectors. I think it could be shorter by using ^ for the cross-product)

Forgive me but I am learning, and it has been many years since I graduated.

Can someone specifically describe each variable and expression in the above swirl code by Niklas? I would like to use the code, but I try to know why mathematical concepts exist. I thank you in advance.

Muyiwa April 21, 2020 05:50

funkySetFields
 
Hello Foamers

Please show me how to use funkySetFields to create an undulating initial field for alpha.water in the damBreak tutorial. I want to use undulating surface instead of the boxToCell used in the setFields of the tutorial.

Youngxl August 10, 2023 03:25

Hi Bernhard,
I just finished watching your video on swak4foam and pyfoam in the of workshop journal this morning, and I benefited a lot. But I noticed that you mentioned in the video that foam-extend doesn't have fvoption now. Is this true? I'm thinking about using fe-4.1 to do a problem, and I just want to use fvoption. If I can't use it, that's a pity.
With regards,
Young

gschaider August 10, 2023 07:34

Quote:

Originally Posted by Youngxl (Post 854992)
Hi Bernhard,
I just finished watching your video on swak4foam and pyfoam in the of workshop journal this morning, and I benefited a lot. But I noticed that you mentioned in the video that foam-extend doesn't have fvoption now. Is this true? I'm thinking about using fe-4.1 to do a problem, and I just want to use fvoption. If I can't use it, that's a pity.
With regards,
Young

Forgot I mentioned that


Yes. AFAIK there are no fvOptions in foam-extend. Reason is (as far as I understand) that the developers of that fork think it is not a good idea to allow ThirdParty-code to mess around with the matrix (in that case a proper solver should be written). But not my project. So you better ask Hrvoje Jasak

Youngxl August 10, 2023 09:01

Quote:

Originally Posted by gschaider (Post 855018)
Forgot I mentioned that


Yes. AFAIK there are no fvOptions in foam-extend. Reason is (as far as I understand) that the developers of that fork think it is not a good idea to allow ThirdParty-code to mess around with the matrix (in that case a proper solver should be written). But not my project. So you better ask Hrvoje Jasak

Okay, thanks for your suggestion!


All times are GMT -4. The time now is 20:34.