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/)
-   -   Can anybody give me advice (https://www.cfd-online.com/Forums/openfoam-solving/60532-can-anybody-give-me-advice.html)

luckyluke April 13, 2005 04:13

I work on the solver 'interFoa
 
I work on the solver 'interFoam'.

I want to add a few codes in it to track the interface. Initial 'Gamma' field are defined using 'setGammaDamBreak'. I store the initial interface points with array.

In the code, the gamma, pd and U are updated using original VOF method. Then the interface points defined in the array are updated according to dx/dt=u,dy/dt=v, etc. The velocity u and v of the interface point is approximated using the value of the nearest cell.

Unfortunately, I can only achieve oscillating interface instead of smooth one. Why? What should be modified in my code?

Thank all.

eugene April 13, 2005 11:08

Interpolate the U field onto y
 
Interpolate the U field onto your interface points instead of using the cell values.

Why do you want to track the interface with marker particles?

rolando August 3, 2005 08:06

Iīm checking in and out "geome
 
Iīm checking in and out "geometricField"-objects in the object-registry on demand by using "regIOobject::checkIn()" and "regIOobject::checkOut()". That works fine.
Can anyone tell me if there is a method to check, whether a specific object is checked in or out?
As I see "regIOobject::registries()" doesnīt work as it just checks the ownership and not the status.
Rolando

mattijs August 4, 2005 06:11

you could either add a const a
 
you could either add a const access function to the registered_ flag in regIOobject and recompile

or you can check the objectRegistry itself (access with db()) whether the object is registered:

objectRegistry::foundObject(...)

Why do you have to checkin/checkout manually?

rolando August 4, 2005 07:23

Thanks Mattijs, as I donīt wa
 
Thanks Mattijs,
as I donīt want to manipulate the Foam core functionality I chose the second suggestion.
The reason to checkIn/Out is: I do some averaging of the simulation results. Which fieldīs to average is runtime selectable to save both memory and disk space. Therefore I do manually checkIn/Out of the geometricFields.
Rolando

niklas August 4, 2005 08:28

This can be done more easily b
 
This can be done more easily by just reading name-lists of
scalar/vector/tensor fields of the variables you want to average and adding them to the main application.

Much similar to the problem being discussed in the 'pollutant dispersion...' thread.

...or have i missed something.

N

rolando August 4, 2005 08:49

Thanks Niklas, I think thatīs
 
Thanks Niklas,
I think thatīs what Iīm actually doing.
I do a runtime lookup of the field names to average. I create the fields and store them in a table (not a list).
As the fields should also be destroyed when they are no longer used, I (think I) need to check them out before destoying them.
It seems to work.

Rolando

henry August 4, 2005 08:54

The checkIn and checkOut are a
 
The checkIn and checkOut are automated, you shouldn't need to call these functions yourself.
When you destroy the field it should check itself out of the database however checking it out yourself should not cause any problems it's just unnecessary.

rolando August 4, 2005 09:03

CheckingIn is done automated.
 
CheckingIn is done automated. I do not have to call "checkIn()".
I store the fields in a "HashPtrTable". When I destroy them by calling "HashPtrTable::erase()" the field is not checked out of the database. At least calling "objectRegistry::names()" still displays the name of the field. If I call "checkOut()" before calling "HashPtrTable::erase()" the field name doesnīt appear any longer.

henry August 4, 2005 09:12

It looks like you are creating
 
It looks like you are creating a copy which you are deleting but leaving the original in the database.

rolando August 4, 2005 09:43

Thanks Henry Thatīs not good.
 
Thanks Henry
Thatīs not good. I have to check this out.

Rolando

rolando August 4, 2005 11:20

As you said Henry. Now it work
 
As you said Henry. Now it works fine.
Thanks
Rolando


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