|
[Sponsors] |
Developing Forced Homogenous Isotropic Turbulence Solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 30, 2022, 23:09 |
Developing Forced Homogenous Isotropic Turbulence Solver
|
#1 |
Senior Member
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10 |
Dear Foamers,
I am trying to replicate the following work in OpenFoam. https://gfs.sourceforge.net/examples...urbulence.html https://gfs.sourceforge.net/examples...lence.gfs.html Here is the piece of code I have added in interFoam as I want to study interaction of vortices and droplet in future. Ueqn: Code:
label nCells = returnReduce(mesh.cells().size(), sumOp<label>()); vector Ubar(gSum(U)/nCells); Code:
solve ( UEqn == fvc::reconstruct ( ( // mixture.surfaceTensionForce() sigma*fvc::snGrad(alpha1)*fvc::interpolate(C) - ghf*fvc::snGrad(rho) - fvc::snGrad(p_rgh) + fvc::flux(1e-1*(1-alpha1)*rho*(U-(Ubar*dimChange2))*dimChange1) // + fvc::flux(1e-1*(1-alpha1)*rho*(U)*dimChange1) ) * mesh.magSf() ) ); pEqn: Code:
surfaceScalarField phig ( ( // mixture.surfaceTensionForce() sigma*fvc::snGrad(alpha1)*fvc::interpolate(C) // sigma*lambda*fvc::interpolate(C)/dimChange - ghf*fvc::snGrad(rho) + fvc::flux(1e-1*(1-alpha1)*rho*(U-(Ubar*dimChange2))*dimChange1) // + fvc::flux(1e-1*(1-alpha1)*rho*(U)*dimChange1) )*rAUf*mesh.magSf() ); writting Fluctuating KE and Dissipation energy Code:
label nCells1 = returnReduce(mesh.cells().size(), sumOp<label>()); vector Ubar(gSum(U)/nCells1); volScalarField magU(Foam::mag(U)); volVectorField lapU(fvc::laplacian(U)); volScalarField newnu(alpha1*nu1 + alpha2*nu2); volScalarField epsilonRes(U & lapU); scalar l = 0; scalar l0 = 0; scalar l1 = 0; scalar l2 = 0; scalar V = 0; scalar dis = 0; forAll(mesh.C(), I) { l0 = 0.5*((U[I].component(0)-Ubar.component(0))*(U[I].component(0)-Ubar.component(0)))*mesh.V()[I]; l1 = 0.5*((U[I].component(1)-Ubar.component(1))*(U[I].component(1)-Ubar.component(1)))*mesh.V()[I]; l2 = 0.5*((U[I].component(2)-Ubar.component(2))*(U[I].component(2)-Ubar.component(2)))*mesh.V()[I]; l = l + (l0+l1+l2); V = V+mesh.V()[I]; dis = dis -(epsilonRes[I]*newnu[I]*mesh.V()[I]); } l=l/V; dis=dis/V; // Create the KE file if not already created if (KE.empty()) { Info<< "Kinetic Energy in present time step:" << l << endl; // File update if (Pstream::master()) { fileName Kdat; word name_ = "Kdat"; // Open new file at start up KE.reset(new OFstream("Kdat.dat")); } } if (Pstream::master()) { KE() << runTime.timeName() << tab << l << tab << dis << endl; } The issue is I am getting monotonically decreasing KE. It is not fluctuating even for a long run. I am using the same parameter as in the example case of Gerris. my nu=1e-2, rho=1 for both the fluid, alpha is 0 everywhere for all the time steps, boundary condition cyclic for all the field. I tried running case in the finest level 128*128*128 also. Not sure what is the cause for this. Any help is deeply appreciated. Thanks krishna kant |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question about matching of solver and turbulence model | louistse | OpenFOAM Running, Solving & CFD | 1 | February 1, 2017 21:36 |
Turbulence postprocessing | Mohsin | FLUENT | 2 | October 3, 2016 14:18 |
DNS of isotropic turbulence | cfdbuddy | Main CFD Forum | 0 | June 27, 2008 02:45 |
Help needed on homogeneous isotropic turbulence an | Guoping Xia | Main CFD Forum | 0 | March 12, 2006 21:54 |
Isotropic homogenous turbulence. | Cool Joe. | Main CFD Forum | 4 | August 1, 2004 17:15 |