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

An implicit source term which is a function of several cell values.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2020, 18:53
Lightbulb An implicit source term which is a function of several cell values.
  #1
New Member
 
Kipri
Join Date: Mar 2020
Posts: 1
Rep Power: 0
foamnoob11 is on a distinguished road
Hello Foamers,

I'm trying to implement an implicit source term along the lines of fvm::Sp(coeff, f(U) ) for an

fvVectorMatrix quantity (namely U in this case) :

Code:
fvVectorMatrix UEqn (
            fvm::ddt(U)
          + fvm::div(phi, U)
          - fvm::laplacian(nu, U)
           ==  fvm::Sp(coeff, f(U))
);
where 'coeff' is an already defined volScalarField, f(U) --> is a vector quantity which is calculated as a weighted average (like a filter) of U from 'surrounding cells'
(this weighting calculation is done.)


Any ideas on how to implement such a source term implicitly ? (or any pointers where such a thing has been done? )

Thank you very much.
Kipri.
foamnoob11 is offline   Reply With Quote

Old   March 4, 2020, 04:45
Default
  #2
Senior Member
 
kimy
Join Date: Mar 2019
Location: https://t.me/pump_upp
Posts: 164
Rep Power: 7
qi.yang@polimi.it is on a distinguished road
Send a message via ICQ to qi.yang@polimi.it Send a message via AIM to qi.yang@polimi.it Send a message via Yahoo to qi.yang@polimi.it
Hi Kipri,

I am now facing the similar problem like yours.

Now I need to implement the wall shear stress for solid phase (twophaseeulerfoam) through a source term in the momentum equation. The wall shear stress can be obtained via the following formular:

Sp=Tauw=alpha1*rho1*st*(U1.component(2).boundaryFi eld ()[patchi].patchInternalField())
*(U1.boundaryField()[patchi].patchInternalField() - U1.boundaryField()[patchi])

where "st" is the friction factor which should be calculated ieratively through
for (int i=0; i<10; i++)
{
st = sqr(kappa)/Log(E*Res*sqrt(st));
}
where "Res" is the Reynolds number of solid which calculated by Res=rho1*U1.component(2).boundaryField()[patchi].patchInternalField()*y[facei]/mus

However, now I wrote the codes in the Uequation but cannot be compiled. If you have some ideas, please tell me. Thanks.
qi.yang@polimi.it 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using PengRobinsonGas EoS with sprayFoam Jabo OpenFOAM Running, Solving & CFD 35 April 29, 2022 15:35
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 09:07
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42


All times are GMT -4. The time now is 07:31.