CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

[HOW TO] solve the velocity components (Ux and Uy) from 2 equations

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2020, 13:16
Question Fornulation
  #21
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 355
Rep Power: 12
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Thank you for your response ^_^
Quote:
Here is a thought: instead of solving an equation for U, simply calculate the other quantities such as p2, del X U, and then directly update the velocity instead of solving an equation for U.
p2 can be solved only after calculating velocity (U). and then how to calculate del X U explicitly as such ? I couldn't get it here..
  1. From velocity matrix equation --> velocity is solved (with velocity as only dependent variable).
  2. In pressure equation, p2 is solved after solving velocity (pressure equation contains velocity variables on R.H.S of the equation)
Basically in OpenFOAM, pressure and velocity will be coupled, but not in my case.
Quote:
Keep in mind that this approach probably needs a carefully drafted formulation.
I am not familiar with this problem, so I cannot help with the formulation, and I don't know what potential issues may crop up in doing so. Perhaps you can find some insight in the literature?
Could you please give me some hints about the drafted formulation, which you are talking about and in terms of literature too.

Thank you
Kummi is offline   Reply With Quote

Old   March 6, 2020, 14:43
Default
  #22
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16
adhiraj is on a distinguished road
Quote:
Originally Posted by Kummi View Post
p2 can be solved only after calculating velocity (U). and then how to calculate del X U explicitly as such ? I couldn't get it here..
I don't get what is so hard to understand here. Here's what I mean:
  1. At any time level n, you have a velocity \mathbf{u}^{n}, and a pressure p^{n}. At time t = 0, \mathbf{u}^{n} and p^{n} are obtained from the initial conditions.
  2. Using the value of \mathbf{u}^{n} obtain quantities such as curl of velocity, and any other terms needed to solve the pressure equation.
  3. Solve the pressure equation to obtain p^{n + 1}.
  4. Using the values calculated in steps 2 and 3, compute \mathbf{u}^{n + 1}.
  5. Repeat the loop until your criterion for convergence is met.

Quote:
Originally Posted by Kummi View Post
Could you please give me some hints about the drafted formulation, which you are talking about and in terms of literature too.
You will need to work out the details, since I am not familiar with this particular topic. Try to find in the literature how other people have worked on this topic.
adhiraj is offline   Reply With Quote

Old   March 8, 2020, 14:29
Default
  #23
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 355
Rep Power: 12
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Thank you for your comments.
One of my friend helped to find a way somehow, however not that clear (by cross-checking with icoFOAM incompressible solver). Some manipulations are made here without affecting the flow physics.

Quote:
{

Ustar = dummy*U;
fvVectorMatrix UstarEqn // Solving velocity
(
fvm::ddt(Ustar) // UNIT -1/s
+ (fvc::curl(U)) // UNIT -1/s
- ((U^(fvc::grad(God)))/(0.4343*(God))) // UNIT -1/s
);
solve(UstarEqn == fvc::grad(Foam::sqrt(p2))*dummy2); //Solving "UstarEqn" w.r.t "p2"
U= Ustar/dummy; //Updating "U"
Ux = U.component(vector::X);
Uy = U.component(vector::Y);
}
solve
(
fvm::laplacian(p2) == - (2*T*R)*((God*RRg) + (rho*(Ux+Uy)*graddUx)) // solving pressure
);

runTime.write()
Quote:
volScalarField dummy
(
IOobject
(
"dummy",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dummy", dimensionSet(0,-1,1,0,0,0,0),1.0)
);
The units of dummy and dummy2 variables are adjusted accordingly.

After compiling the above code, the velocity is resolved, however when time increases, the magnitude of velocity increases randomly as shown in the attachment.
Attached Files
File Type: gz Velocity magnitudes.tar.gz (56.7 KB, 6 views)
Kummi is offline   Reply With Quote

Old   March 13, 2020, 03:33
Default
  #24
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 355
Rep Power: 12
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
My code is compiled good, velocity contour changes appropriately. But there is problem with magnitude of velocity - which varies in very random manner. In general, my case is steady in flow. But, I introduced unsteady (fvm::ddt) term - mainly for the compilation of matrix equation. When running unsteady case,
  • For t=2s, U =36 m/s
  • For t=50s, U =3,321 m/s
  • For t=100s, U =6,743 m/s
  • For t=200s, U =13,587 m/s
This magnitude changes are really unrealistic. In above thread, I attached the velocity contour plot.
In order to resolve this unrealistic magnitude changes, I tried changing boundary conditions and manipulated the code further, but I couldn't able to figure out how to resolve this.
Quote:
Pressure boundary file

dimensions [ 2 -2 -4 0 0 0 0 ];
internalField uniform 1e10;
boundaryField
{
hotSide // flow outlet
{
type fixedValue;
value uniform 1e10;
}

top // flow outlet
{
//type calculated;
type fixedValue;
value uniform 1e10;
}

right
{
type symmetry; //symmetryPlane; // zeroGradient;
}


bottom
{ type zeroGradient; }

front
{ type empty; }

back
{ type empty; }
}
Quote:
Velocity boundary file
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
hotSide
{
type calculated;
value uniform (0 0 0);
//type zeroGradient;
/* type inletOutlet;
inletValue $internalField;
value $internalField;
*/

}

top
{
//type zeroGradient;
type calculated;
value uniform (0 0 0);
/*
type inletOutlet;
inletValue $internalField;
value $internalField;
*/

}

right
{
type symmetry; //symmetryPlane; // zeroGradient;
}

bottom
{ type noSlip;
/*
type fixedValue;
value uniform (0 0 0);
*/

}

front
{ type empty; }

back
{ type empty; }
}
I fixed the above boundary conditions for pressure and velocity.

Any ideas as how to proceed further ?
THank you ^^
Attached Files
File Type: gz Kummi_new.tar.gz (194.7 KB, 1 views)

Last edited by Kummi; March 21, 2020 at 09:23.
Kummi 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



All times are GMT -4. The time now is 23:04.