CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to add the RhO to the icoStructFoam (https://www.cfd-online.com/Forums/openfoam-solving/59195-how-add-rho-icostructfoam.html)

msha January 21, 2008 00:34

you have not recognized progra
 
you have not recognized programming in C++ using FOAM classes

fw407 January 21, 2008 05:28

Hi, Mojtaba Thanks for your
 
Hi, Mojtaba

Thanks for your advice.

I find myself really lost when hanling FOAM classes, which is my biggest problems in understanding and modifying a solver. My C++ knowledge is in a relative low level and I want to start from the bottom, Could you give some ideas how to do it?

All the best

Feng

grtabor January 21, 2008 06:26

Dear Feng, I have written a
 
Dear Feng,

I have written an intro to programming in OpenFOAM - send me your email address and I'll email it to you (my email address is g.r.tabor@ex.ac.uk)

Gavin

gschaider January 21, 2008 12:40

Hi Feng! In the exchange li
 
Hi Feng!

In the exchange line write

rhoFluid.value()*fluidP

instead of

rhoFluid*fluidP

Have a look at the dimensioned-template to understand why

Bernhard

fw407 January 21, 2008 19:19

Dear Gavin My email addres
 
Dear Gavin

My email address is feng.wang207@imperial.ac.uk

All the best

Feng

fw407 January 21, 2008 19:35

Hi, Bernhard, Now I can com
 
Hi, Bernhard,

Now I can compile the solver , but the caculation blows off as soon as it is strted, Below is the end of the caulation

Time = 1


Moving mesh

Correct mesh motion diffusion field.
ICCG: Solving for motionUx: solution singularity
ICCG: Solving for motionUy: solution singularity
ICCG: Solving for motionUz: solution singularity

Biggest movement: 4.73178e+173 Bigges divergence 1.09837e+158
Solving flow in mesh1

Mean and max Courant Numbers = nan nan
BICCG: Solving for Ux: solution singularity
BICCG: Solving for Uy: solution singularity
ICCG: Solving for p: solution singularity
ICCG: Solving for p: solution singularity
ICCG: Solving for p: solution singularity
time step continuity errors : sum local = nan, global = nan, cumulative = nan
ICCG: Solving for p: solution singularity
ICCG: Solving for p: solution singularity
ICCG: Solving for p: solution singularity
time step continuity errors : sum local = nan, global = nan, cumulative = nan

Solving structure in mesh2

ICCG: Solving for Udispx: solution singularity
ICCG: Solving for Udispy: solution singularity
Max sigmaEq = inf
Max sigmazz = 0

Maximum Displacement: 4.73178e+173

The maximum displacement is terribly wrong.

By the way, I set the density of the fluid to be 1000 kg/m^3.

All the best

Feng

gschaider January 23, 2008 19:07

Hi Feng! Check the boundary
 
Hi Feng!

Check the boundary conditions for the mesh motion. If they are all Neumann and no Dirichlet the motion-solver has no fixed point and "shoots" the grid to infinity.

Bernhard

fw407 January 24, 2008 17:10

Hi Bernhard! Thanks for you
 
Hi Bernhard!

Thanks for your help!

In fact, I have set the density of fluid to be 1 kg/m^3 for test, but the caculation still blows up.

I am now trying your method, and have not worked it out.

By the way, I am just wondering if I replace the original one with
solidP[exchange[fI]]=rhoFluid.value()*fluidP[fI];
we all know OF also does the dimension checking, So after I make that change, the dimension on the right side of "=" will also change. The pressure tranfered to the solid structure will have the dimension of N/m^2, not m^2/s^2. I guess that might also be a problem


All the best

Feng

gschaider January 25, 2008 08:46

Hi Feng! Dimensions are onl
 
Hi Feng!

Dimensions are only checked if you do the operations on the whole field. If you do it on a single-element level (like the example above) nothing will be checked (for performance reasons). In other words: you can be as unphysical as you like. Or: You have to ensure yourself, that what you do is correct.

Bernhard


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