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

Linearized Navier Stokes Solver

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By AndreaCFD
  • 1 Post By stanweer
  • 1 Post By dlahaye

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2020, 18:16
Default Linearized Navier Stokes Solver
  #1
New Member
 
Join Date: Sep 2020
Posts: 9
Rep Power: 6
AndreaCFD is on a distinguished road
Dear members,

I am trying to implement a Linearized Navier-Stokes solver for incompressible fluids inside OpenFoam. I read some articles and discussions in the forum but I some concepts which are not clear to me.

Knowing that the LNSE are:

\frac{\partial U }{\partial t}=-(U_s \cdot \nabla) U - (U \cdot \nabla) U_s + \nu \nabla^2 U - \frac{1}{\rho} \nabla p

where U_s is the equilibrium solution and U and p are the small perturbations from it.

I wanted to modify the icoFoam.C solver in the following way:

Code:
	        fvVectorMatrix UEqn
        (	
			fvm::ddt(U)-
			fvm::laplacian(nu, U)+
			fvm::div(phi_zero, U)+
			fvc::div(phi,U_zero)
        );
and defining in the createFields.H the new quantities:

Code:
Info<< "Reading field U_zero\n" << endl;
volVectorField U_zero
(
	IOobject
		(
		"U_zero",
		runTime.constant(),
		mesh,
		IOobject::MUST_READ,
		IOobject::NO_WRITE
		),
	mesh
);

surfaceScalarField phi_zero
(
	IOobject
		(
		"phi_zero",
		runTime.constant(),
		mesh,
		IOobject::READ_IF_PRESENT,
		IOobject::NO_WRITE
		),
		//fvc::flux(U_zero)
	linearInterpolate(U_zero) & mesh.Sf()
);
I already calculated the U_zero velocity field in a previous simulation and I want the solver to read it from the constant folder. The file is like :

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U_zero;
}
dimensions      [0 1 -1 0 0 0 0];


internalField   nonuniform List<vector> 
30000
(
.
.
.
)
;
boundaryField
{
.
.
.
}
------------------------------------------------------------------------------
The solver compiles good and the simulation runs but the results I get are not the ones I expected.
I do not understand whether there is something wrong in the code or there is a mistake in the initial and boundary conditions I set.

Can somebody help me please?

Thanks in advance,

Andrea
Dr. Ravi kant likes this.

Last edited by AndreaCFD; September 23, 2020 at 20:19.
AndreaCFD is offline   Reply With Quote

Old   September 25, 2020, 11:21
Default
  #2
New Member
 
shayan tanweer
Join Date: Oct 2016
Location: DELHI,INDIA
Posts: 4
Rep Power: 10
stanweer is on a distinguished road
Your code seems to be right.

What boundary conditions did you use?
Dr. Ravi kant likes this.
stanweer is offline   Reply With Quote

Old   September 28, 2020, 04:17
Default
  #3
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 798
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Does pEqn.H require corresponding modification? The current implementation seems to solve for a non-physical pressure. The pressure-velocity coupling makes the model non-linear as is likely to affect the computed velocity field.

Does it make sense to modify scalarTransportFoam from a scalar field being convected (as currently the case) to a velocity field being convected. In this way the pressure field is no longer in your way.
Dr. Ravi kant likes this.
dlahaye is offline   Reply With Quote

Reply

Tags
linearized navier stokes


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 10:52
Navier Stokes Solver Khan Main CFD Forum 2 December 12, 2006 10:41
ILU for Navier stokes problems Raju Main CFD Forum 5 July 29, 2006 15:15
help: I am trying to solve Navier Stokes compressible and viscid flow Jose Choy Main CFD Forum 2 May 18, 2000 06:45


All times are GMT -4. The time now is 12:08.