CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   try to creat Splash in PatchInteractionModel (https://www.cfd-online.com/Forums/openfoam/137130-try-creat-splash-patchinteractionmodel.html)

brbbhatti June 10, 2014 17:46

try to creat Splash in PatchInteractionModel
 
I'm implementing Splash module as PatchInteractionModel. I am unable to understand the Correct function in every PatchInteractionModel implementation.Can anyone tell me from where Correct function is called and where I have to add my own functions besides Correct function

src / lagrangian / intermediate / submodels / Kinematic / PatchInteractionModel

brbbhatti June 12, 2014 09:54

Unknown Patch Interaction Model
 
Hello everyone,

I am trying to implement a new model in Patch Interaction Model name Splash. I make a new correct function and make a new .C and .H file for splash. Then i add splash function in PatchInteraction model as they both are interconnected.

Then i add these files in Intermediate folder replacing the old Patch Interaction Model files and also make a new folder for splash Model.

I rename the Make file
Quote:

LIB = $(FOAM_USER_LIBBIN)/liblagrangianIntermediate_new
And then compile it by running

wclean
wmake libso


Then compile a new solver without any error.

But when i run it using the solver it give the following error :


Quote:

Constructing 3-D injection
Selecting distribution model uniform
Selecting patch interaction model splash


--> FOAM FATAL ERROR:
Unknown patch interaction model type splash

Valid patch interaction model types are:
5
(
localInteraction
multiInteraction
none
rebound
standardWallInteraction
)
From function PatchInteractionModel<CloudType>::New(const dictionary&, CloudType&) in file /home/bhb8fe/OpenFOAM/2.1.0/lib/lagrangian_new/intermediateSplash/lnInclude/PatchInteractionModelNew.C at line 54.
Can anyone tell me what can i do , where i have to add:rolleyes: this splash Model so that the solver can call it.

dkxls June 16, 2014 10:13

1 Attachment(s)
I wouldn't recompile the whole Lagrangian intermediate library only for a new sub-model.

I attached a small example that shows you how to implement your own patch interaction model in a user defined library.

Linking that library to a solver at compile or run-time is explained here (scroll down to the bottom of the page):
http://www.openfoam.org/docs/user/co...plications.php

brbbhatti June 16, 2014 10:38

Hi Armin,

Thanks , i already read that link and i had a problem in calling the model when i try to run it. I compile the library and solver and that was ok but it was not recognizing the new model but now i got it that i have to mention it also in BasicKinematicParcelsubmodle.
but now i have some other problem because now it is not compiling the library.

I just have one question in

" How can i make changes in that or make new cloud type instead of correct

Quote:

template<class CloudType>bool Foam::PatchInteractionModel<CloudType>::correct
(
typename CloudType::parcelType&,
const polyPatch&,
bool&,
const scalar,
const tetIndices&
)
I tried to do some changes but it always says it is not the right <cloudtype>.

Can you just give me some hint or idea how can i make changes in that.

Regards,

Bilal

Tobi July 1, 2014 06:21

Hi Bilal,

a very good and smooth way is
  • copy a existing and working model
  • rename the copied folder and files
  • rename the class and member names (as you wish)
  • change the necessary functions (like in ::correct)

brbbhatti July 1, 2014 07:58

Hi Tobi,

Thanks for your time and reply.

I done that what you have written here. but porblem is that when i change the necessary functions like in :: correct i add some more functions which i needed it will not take them and give error like "not declared in scope, or Not a type".

So i make a new void-class-splash and its working now but when i want to use some equations from previous model then its says "shadow a vector" can you tell me how can i overcome this problem as my C++ is not strong.

Thanks.

Best regards,
Bilal

Tobi July 1, 2014 08:00

In that case I can not give you any hint - sorry.


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