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

Cht tutorial in 15

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

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2011, 05:13
Default
  #181
Senior Member
 
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17
mabinty is on a distinguished road
hi!

Quote:
Where line 71 is "globalBoundaryList = buildGlobalBoundaryList(mesh); " as described above. I suppose, that "mesh" is only used to describe what has to be done in something like a meta language rather than the correct syntax. What should be used there instead?
Code:
globalBoundaryList = buildGlobalBoundaryList(fluidRegions[i]);
cheers,
aram
mabinty is offline   Reply With Quote

Old   March 10, 2011, 06:00
Default
  #182
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hey Aram!

Thanks for your code, that was exactly, what I was looking for. Indeed, as I expected, one has to refer to the fluid regions (resp. their meshes) seperately. I just didn't know the correct syntax (learned some ANSI C some years ago, don't know the syntax of C++ too much) and the object structure of OpenFoam is still a miracle to me...

Thanks a lot, I'm going to start some tests with that right now...

Ciao
Wolle

P.S.: As I intended to calculate heat flux over the boundaries later on, this is also a nice tutorial and a good point to start I think...

EDIT: Strange that I can only see your postings just after posting a reply myself - updating the browser page doesn't help so far? Strange...
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   March 10, 2011, 06:32
Default
  #183
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
As boundary face normals point outwards of the domain, I suppose positive flux values should be read as a flux of mass leaving the domain?
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   March 10, 2011, 07:02
Default
  #184
Senior Member
 
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17
mabinty is on a distinguished road
correct! positive flux = out of the domain; negative flux into domain.

aram
mabinty is offline   Reply With Quote

Old   March 14, 2011, 05:40
Default
  #185
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi all,

I tried the waveTransmissive bc just for the ceiling, while all other patches remained walls. This looked good at first sight, but then the case ran into problems... I think due to inappropriate geometry.

So I chose to use waveTransmissive BC for left, right and top. First 200 time steps look good so far. At the moment I'm running this for a longer time just to see, what happens...

I tried to clean up the case, translated the comments into (maybe somehow humble) English and packed things up together with the modified solver (mass flux calculation). Here it is, feel free to comment...

Ciao
Wolle

P.S.: I didn't get tar to produce multiple volumes and due to the upload file size restrictions, I packed everything up with 7z, which should be installed on most Linux machines (or can be installed through official repositories). As the file attachment dialogue doesn't accept the file endings, I added ".doc". To unpack simply remove ".doc" from the file names, rightclick and unpack with 7z...
Attached Files
File Type: doc case.7z.001.doc (90.0 KB, 15 views)
File Type: doc case.7z.002.doc (16.8 KB, 6 views)
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   March 17, 2011, 11:18
Default
  #186
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi all!

I think, I've got a nice setup now, that will do for my purposes. Now I intend to include heat flux calculation similar to the mass flux calculation.

Do I have to include it this way or is there already a feature doing this?

As I don't know, where to start and the documentation remains rather cryptic to me... could someone please explain, what the lines
Code:
flux = sum(phi.boundaryField()[patchIndex]);
and
Code:
reduce(flux, sumOp<scalar>());
do?

The first line calculates the sum of phi at the boundary field of the processed patch, I think. But so far I couldn't find out, where to look for what the sum() function REALLY does, what arguments it takes, what it gives as return value etc. Please help me to help myself and give a hint, where to look in order to find the solution by myself.

I'm totally clueless, what the second line does. But in the end it's the same: I just don't know, WHERE to look in the code...

Ciao
Wolle
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   March 17, 2011, 18:12
Default
  #187
Senior Member
 
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16
Daniele111 is on a distinguished road
Hi all
Where can i find multiRegionLiquidHeater solver?

Thanks
Daniele111 is offline   Reply With Quote

Old   March 22, 2011, 11:27
Default
  #188
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi all!

I dug in the depths of the "C++ Source Guide"... is that the same as what's known as "Doxygen"? However: it's really confusing. Is there something like a beginners guide to that?

In order to calculate heat flux at the borders, I thought about this a little. With respect to my setup (fluid with solid heater of constant temperature), I think at first I'd like to sum up the heat flux at the boundaries. At the moment, I'm not even sure, which variables I can use and how to do this in the end. All I write from now on, refers to the chtMultiRegionFoam solver as of OF-1.7.

From reading the code (and trying hard to understand), some questions arise. The fields "gh" and "ghf" seem to only calculate the inner product of g and the position of the cell/face centre, returning a scalar. What are those fields for?

Now, what's even more interesting, is the thermoFluid stuff.

In createFluidFields.H, line 22, it says:
Code:
        Info<< "    Adding to thermoFluid\n" << endl;
        thermoFluid.set
        (
            i,
            basicPsiThermo::New(fluidRegions[i]).ptr()
        );
So, what does this mean? Does every fluidRegion now have a "thermoFluid" property of basicPsiThermo type? Or is the region itself of basicPsiThermo type? basicPsiThermo inherits the p field (volScalarField) from basicThermo which is used later on (calculating p_rgh) is that right so far?

The basicThermo class also has other interesting properties/functions:
* rho Density [kg/m^3].
* h Total enthalpy [J/kg].
* hs Sensible enthalpy [J/kg].
* e Internal energy [J/kg].
* T Temperature [K].
* Cp Heat capacity at constant pressure for patch [J/kg/K].

Now for some of those, there is a further distinction, let's take h for example:
* virtual volScalarField & h () = Total enthalpy [J/kg].
* virtual const volScalarField & h () const = Total enthalpy [J/kg].
* virtual tmp< scalarField > h (const scalarField &T, const labelList &cells) const = Total enthalpy for cell-set [J/kg].
* virtual tmp< scalarField > h (const scalarField &T, const label patchi) const = Total enthalpy for patch [J/kg].

Does that mean, that refering to some basicThermoObject.h(const scalarField &T, const label patchi), which returns a scalarField, gives all the h values at the patch? What patch label to use can be figured out from the calculateMassFlux.H as mentioned above... but what (and how?!!!) to use as T scalar field? Would something like this be correct?
Code:
{
    scalar netHeatFlux = 0;
    forAll (globalBoundaryList, patchI)
    {
        scalar heatFlux = 0;
        label patchIndex = mesh.boundaryMesh().findPatchID(globalBoundaryList[patchI]);
        scalarField totalEnthalpyOfPatchField = h(T, patchIndex); // I know, this variable is not further used...
        if (patchIndex >= 0)
        {
            heatFlux = sum(h.boundaryField()[patchIndex]);
       }
        reduce(heatFlux, sumOp<scalar>());
        Info<< "Heat flux at " << globalBoundaryList[patchI]
            << " = " << heatFlux << endl;
        netHeatFlux += heatFlux;
    }
    Info<< "Net heat flux = " << netHeatFlux << endl;
    cumulativeHeatFlux += netHeatFlux;
    Info<< "Cumulative heat flux = " << cumulativeHeatFlux << endl << endl;
}
But.... OH NO!!!
http://foam.sourceforge.net/docs/cpp...rce.php#l00271
Not implemented?!?!

Well, after all it seems, that I have to refer to hPsiThermo class, as this one is specified in my thermophysicalProperties dictionary. hPsiThermo seems to have cp as well as h. It took me hours to realize that, as I can see no statement in the code, that performs the lookup of that dictionary until now... where can I find that?

Ciao
Wolle

EDIT: Of course h is always positive, so I guess, I would have to calculate h*phi? How to do that?
__________________
CAELinux 2010 -- OpenFOAM 1.7

Last edited by Wolle; March 22, 2011 at 11:46.
Wolle is offline   Reply With Quote

Old   March 22, 2011, 12:49
Default
  #189
Member
 
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16
Wolle is on a distinguished road
Hi all!

Now... in order to get the dimensions right, I think I've got to multiply with deltaT.

Code:
{
    scalar netMassFlux = 0;
    scalar netHeatFlux = 0;
    scalar netHEATFlux = 0;

    forAll (globalBoundaryList, patchI)
    {
        scalar massFlux = 0;
        scalar heatFlux = 0;
        label patchIndex = mesh.boundaryMesh().findPatchID(globalBoundaryList[patchI]);
        if (patchIndex >= 0)
        {
            massFlux = sum(phi.boundaryField()[patchIndex]);
            heatFlux = sum(h.boundaryField()[patchIndex]);
        }
        reduce(massFlux, sumOp<scalar>());
        reduce(heatFlux, sumOp<scalar>());
        scalar HEATFlux = heatFlux * massFlux * runTime.deltaT().value();
        Info<< "Mass flux at " << globalBoundaryList[patchI]
            << " = " << massFlux << endl;
        netMassFlux += massFlux;
        Info<< "Heat flux at " << globalBoundaryList[patchI]
            << " = " << heatFlux << endl;
        netHeatFlux += heatFlux;
        Info<< "HEAT flux at " << globalBoundaryList[patchI]
            << " = " << HEATFlux << endl;
        netHEATFlux += HEATFlux;
    }
    Info<< "Net mass flux = " << netMassFlux << endl;
    cumulativeMassFlux += netMassFlux;
    Info<< "Cumulative mass flux = " << cumulativeMassFlux << endl;
    Info<< "Net heat flux = " << netHeatFlux << endl;
    cumulativeHeatFlux += netHeatFlux;
    Info<< "Cumulative HEAT flux = " << cumulativeHEATFlux << endl;
    Info<< "Net HEAT flux = " << netHEATFlux << endl;
    cumulativeHEATFlux += netHEATFlux;
    Info<< "Cumulative HEAT flux = " << cumulativeHEATFlux << endl;
}
Then, I realized, that phi is of dimension "dimVolume/dimTime"... so that makes the mass flux calculation a rather volumetric flux calculation or did I miss something?

So I guess, I should multiply by rho. As phi and h are summed up for each patch, I think an average rho of the respective patch would be good. How to obtain that?

Yes, I know it's rather ugly code.... please note, that I'm a beginner.

By the way... I still don't know, what the reduce function does?

Ciao
Wolle
__________________
CAELinux 2010 -- OpenFOAM 1.7
Wolle is offline   Reply With Quote

Old   April 18, 2011, 16:29
Default
  #190
Senior Member
 
Francois
Join Date: Jun 2010
Posts: 107
Rep Power: 20
Fransje will become famous soon enough
Hi Wolle,

Look at the following link to (start) to understand what the reduce function does.

Good luck,
Kind regards,

Francois.
Fransje is offline   Reply With Quote

Old   April 19, 2011, 11:08
Default
  #191
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
Quote:
Originally Posted by sebonator View Post
Hi marval,

it's me again ;-)

I just had a look at my cases and realized that I told you something wrong again:
You don't have to indicate something like a "neighbourPatch" in your time directories. What I meant are the keywords "samplePatch" and "sampleRegion" which have to be set inside the constant/Region/polyMesh/boundary-files. Make sure these entries are correct to ensure that your fluid patches sample with the correct solid patches!

Goog luck!
Greetings Sebastian
Looking at OF's tutorial multiRegionHeater, the samplePatch and sampleRegion are set after running allRun. So, I don't think one has to set them ahead of time.

On the other hand, I've seen tutorials where these are set in system/Region/changeDictionaryDict boundary entry.

Mirko
mirko is offline   Reply With Quote

Old   September 22, 2011, 01:19
Default
  #192
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Hi.. Aram,
I have some confusion in boundary condition in chtMultiRegionFoam.. you explain as below...

_solidWallTemperatureCoupledFvPatchScalarField.C:

Foam::tmp<foam::scalarfield>
Foam::solidWallTemperatureCoupledFvPatchScalarFiel d::flux() const
{
const fvPatchScalarField& Kw =
patch().lookupPatchField<volscalarfield,>(KName_);

const fvPatchScalarField& Tw = *this;

return Tw.snGrad()*patch().magSf()*Kw;
}

in this condition, mathematical equestion is K1*T1=K2*T2 ? I am not sure.. please correct me if I am wrong.. if this is correct, How can Implement below boundary condition?
K1*(normal component of gradient (T1))=K2*(normal component of gradient(T2))?

where, K1 and K2 are scalarvolume for different filed respectevely, and T1 and T2 are also scalar for different fields.. actually I want to use for electrostatic problem for multiregion.. in that, K used as permitivitty and T used as electric potential (Volt).

thank you in advance for any help...

kind regards
alpesh
alvora is offline   Reply With Quote

Old   September 22, 2011, 01:23
Default
  #193
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Quote:
Originally Posted by mabinty View Post

_solidWallTemperatureCoupledFvPatchScalarField.C:

Foam::tmp<foam::scalarfield>
Foam::solidWallTemperatureCoupledFvPatchScalarFiel d::flux() const
{
const fvPatchScalarField& Kw =
patch().lookupPatchField<volscalarfield,>(KName_);

const fvPatchScalarField& Tw = *this;

return Tw.snGrad()*patch().magSf()*Kw;
}

thx in advance for any comments!!
aram
Hi.. Aram,
I have some confusion in boundary condition in chtMultiRegionFoam.. you explain as below...

_solidWallTemperatureCoupledFvPatchScalarField.C:

Foam::tmp<foam::scalarfield>
Foam::solidWallTemperatureCoupledFvPatchScalarFiel d::flux() const
{
const fvPatchScalarField& Kw =
patch().lookupPatchField<volscalarfield,>(KName_);

const fvPatchScalarField& Tw = *this;

return Tw.snGrad()*patch().magSf()*Kw;
}

in this condition, mathematical equestion is K1*T1=K2*T2 ? I am not sure.. please correct me if I am wrong.. if this is correct, How can Implement below boundary condition?
K1*(normal component of gradient (T1))=K2*(normal component of gradient(T2))?

where, K1 and K2 are scalarvolume for different filed respectevely, and T1 and T2 are also scalar for different fields.. actually I want to use for electrostatic problem for multiregion.. in that, K used as permitivitty and T used as electric potential (Volt).

thank you in advance for any help...

kind regards
alpesh
alvora is offline   Reply With Quote

Old   September 22, 2011, 04:21
Default
  #194
Senior Member
 
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17
mabinty is on a distinguished road
hi alpesh,

in the solidWallTemperatureCoupledMixed BC the common interface temperature between two regions "0" and "1"is calculated from the energy balance

Code:
diffusiveFlux[region0] = diffusiveFlux[region1]
leading to

Code:
Tw = (K0*intField0/Dx0+K1*intField1/Dx1)/(K0*/Dx0+K1*/Dx1)
where Dx is the distance from the interface to the first internal grid point, and intField the value at this point in the respective region. Tw is set as BC for both regions at the interface based on the mixedFvPatchField BC type (src/finiteVolume/fields/fvPatchFields/basic/mixed). See also Patankar: Numeric Heat Transfer and Fluid Flow, p 44 ff, the code at solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField .C and search the forum for the BC for more info.

hope that helps!

cheers,
aram
mabinty is offline   Reply With Quote

Old   September 22, 2011, 09:40
Default
  #195
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Hello Aram,

Thank you very much for reply..

Kind Regards
Alepsh
alvora is offline   Reply With Quote

Old   February 6, 2012, 11:49
Default Boundary condition in chtmultiregionfoam
  #196
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Hello friends,

I am using chtmultiregionFoam for my case.. my case consists two regions (solid and fluid).. one sphere subjected to under external electric field.. hence, I made geometry in gmsh, one sphere in box, and sphere define as solid and surrounding air region in box defined as fluid, air. I transfer gmshToFoam and made set up.
I don't need NS equation in fluid region and also don't need heat equation in fluid region. Hence, I removed all equation and implement my own equation for both region... I succeed in that.. I run simulation and it's work..
But, I am not sure about boundary condition.. because I used "SolidWallMixedTemperatureCoupled" boundary condition.. My equations (problem) need boundary condition at interface as below:

e1*d/dn(Voltage1)=e2*d/dn(Volatage2) or e1*(En1)=e2*(En2)
where, e1 & e2 is permittivity of solid and fluid, respectively. En is the normal component of electric field strength. electric field strength is also define as : -1*grad(Voltage).

I used "swmtc" boundary condition with K define as "e" and neighbour field define as "voltage".. because in solver code, variable is voltage in both regions.. solver solving equation is: divergence(e*gradient(Voltage))=0


The question is: is it correct boundary condition for above case? or can you tell me that the "SolidWallMixesTemperatureCoupled" b.c. solves which condition at interface? is it solving following condition for temperature.. k1*d/dn(T1)=k2*d/dn(T2) ? where, K is thermal conductivity and T is temperature..

I also tried to read the code file "SolidWallMixedTemperatureCOupledFvPatchScalarFiel d.C" and also ".H".. But, I didn't get completely..

I didn't get:
this->refValue() = nbrIntFld;
this->refGrad()=0.0;
this->valueFraction()=nbrKDelta / (nbrKDelta + myKDelta ());

Can anyone help me to understand these, please?

Kind regards and thanks in advance
Alpesh
alvora is offline   Reply With Quote

Old   June 9, 2015, 21:48
Post Axial pump simulation
  #197
New Member
 
Felipe Condo
Join Date: Jun 2015
Posts: 3
Rep Power: 10
felipecondo92 is on a distinguished road
HI
I'm Felipe a mechanical student from ESPOL, Ecuador. I have to work on the simulation of axial flow pump in Fluent, but i don't even have the geometry does anyone can please help me with this?Please
Thanks
Felipe
felipecondo92 is offline   Reply With Quote

Old   June 10, 2015, 04:02
Default
  #198
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Hi Felipe,

This is a Forum for OpenFOAM users
you will find Fluent User discussing http://www.cfd-online.com/Forums/fluent/
and someone might be able to share a case there
For OpenFOAM there is Special Interest Group Turbomachinery that provides some Validation test cases
see->The DARPA HIREP (High Reynolds Number Pump) axial flow pump
http://openfoamwiki.net/index.php/Si...ion_test_cases if you want to convert that case to fluent
there is a tool foamMeshToFluent that writes out the OPENFOAMŪ mesh in Fluent mesh format , but you have to install OF to use that tool.
My guess among the Fluent users someone might have a case for you that need no converting
elvis is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
---------Tutorial help mech FLUENT 4 May 16, 2007 03:43
tutorial 6 in Fluent 6.2 tutorial and Mesh pilli4u FLUENT 2 April 2, 2007 06:09
3D Tutorial MJ FLUENT 0 January 16, 2007 09:45
tutorial masood yooceframandi FLUENT 1 January 25, 2005 13:28
tutorial adil FLUENT 0 March 8, 2004 04:48


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