CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

fvOptions meanvelocityForce to localvelocityforce

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 7, 2017, 07:10
Default fvOptions meanvelocityForce to localvelocityforce
  #1
Senior Member
 
Join Date: Jan 2014
Posts: 138
Rep Power: 5
hxaxtma is on a distinguished road
Hi guys,
did someone of you tried to rewrite the meanVelocityForce fvOptions files to a localVelocityForce one?
Which means I want to model a non-slip wall by imposing velocity to (0 0 0) with respect to local velocity distribution at each cell of the cellset.

So far I managed to rewrite the code successfully up to here:
Code:
void Foam::fv::localVelocityForce::addSup
(
    fvMatrix<vector>& eqn,
    const label fieldI
)
{   
       
	scalar gradP = gradP0_ + dGradP_;
	scalarField gradPlocal_ = gradP0_ + dGradPlocal_;

	DimensionedField<vector, volMesh> SuI
    (
        IOobject
        (
            name_ + fieldNames_[fieldI] + "_SuI",
            mesh_.time().timeName(),
            mesh_,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        mesh_,
        dimensionedVector("zero", eqn.dimensions()/dimVolume, vector::zero)
    );
/*
    forAll(cells_, i)
    {
		label cellI = cells_[i];
		SuI[cellI] += flowDir_*gradPlocal_[cellI];
	}
*/


		UIndirectList<vector>(SuI,cells_) = flowDir_*gradPlocal_; ->This line is the problem!!!!

    eqn += SuI;
  
}
The problem is caused by gradPlocal_ which is a scalarField multiplied by flowDir_ equals in a volVectorField.

So my question is, how can I use UIndirectList as a volVectorField.
Or is there a way to impose Sui as volVectorField directly within the last line eqn +=SuI?
Thanks in advance

Last edited by hxaxtma; March 8, 2017 at 19:39.
hxaxtma is offline   Reply With Quote

Old   March 8, 2017, 19:39
Default
  #2
Senior Member
 
Join Date: Jan 2014
Posts: 138
Rep Power: 5
hxaxtma is on a distinguished road
no one has an idea?
hxaxtma is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fvOptions MRF error vijaykamesh OpenFOAM 1 July 28, 2016 09:37
fvOptions with twoPhaseEulerFoam: momentumSource tidusuper91 OpenFOAM Pre-Processing 2 March 21, 2016 06:39
How to set fvOptions yurifrey OpenFOAM Pre-Processing 5 February 22, 2016 19:14
problem with fvOptions in twophase eulerfoam Hamzeh_Mirab OpenFOAM Running, Solving & CFD 0 January 27, 2015 12:04
Can I use fvOptions to couple a solid region and a fluid region? titanchao OpenFOAM Running, Solving & CFD 0 July 24, 2014 13:36


All times are GMT -4. The time now is 16:27.