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

Again on fixing the value of a variable in e certain volume of the domain

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Aurelien Thinat

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 2, 2012, 10:11
Default Again on fixing the value of a variable in e certain volume of the domain
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Dear All,

what I am trying to do has been discussed, yet.

Anyway, I am finding it a bit difficult to find a solution, since there are many threads about this question and I can not cope with them all.

So, I would like to ask you, for help.

What I wanna do is to edit the buoyantSimpleFoam solver, in order to fix the value of the temperature in a sub-volume of my domain.

I have a mesh whit a volume patch which contains the cell I want to fix the T (or h) value.

The problem I have to face first, are the following:
a. in the solver we do not have T, but h. This is not a problem, since for a PIG it stands h = C_p*T, with C_p = const.

Now, the question is: what are the next step?

Following this tutorial I created my own solver buoyantSimpleFoam_Mod.

I edited the file `files' in the Make directory and then I started editing the hEqn.H and the createFields files.

Following this thread, I figured out that my hEqn.H file should looks like this:

Code:
{
    fvScalarMatrix hEqn
    (
        fvm::div(phi, h)
      - fvm::Sp(fvc::div(phi), h)
      - fvm::laplacian(turbulence->alphaEff(), h)
     ==
        fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
      - p*fvc::div(phi/fvc::interpolate(rho))
    );

    hEqn.relax();
    hEqn.setValues(hCells, hVals);
    hEqn.solve();

    thermo.correct();
}
where hCells is a vector of cells and hVals is a vector containing the values that I want to impose at each cell of the hCells vector.

One question that comes to my mind is: where should I define these 2 vectors? And how?
Also, is it possible to insert the label of the volume patch, instead of the label of each cell?

Fuerthermore, I guess that I have to change the file fvSolution in the case/system directory and I think that it is enough to add the following line:
Code:
 
   
hCells	    0;
sVals      1000;
Is that correct? And how can I say to OF that hCells is the vector that contains all the cells in the patch I am interested in?

Could anyone help, please?

Thanks a lot,
Samuele

Last edited by samiam1000; March 2, 2012 at 10:40.
samiam1000 is offline   Reply With Quote

 


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
Error message: Insufficient Catalogue Size Paresh Jain CFX 32 February 3, 2021 03:37
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
[blockMesh] Solid volume inside computational domain francois OpenFOAM Meshing & Mesh Conversion 7 November 19, 2008 16:11
How to compute total liquid volume of the whole domain hsieh OpenFOAM Post-Processing 2 July 13, 2007 18:18
Multi_component Vs Additional Variable Anurag CFX 2 February 4, 2005 16:45


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