GithubHelp home page GithubHelp logo

Comments (4)

sroget avatar sroget commented on July 28, 2024

Hello.
I comment my "progress" and my problems. I have to say that I am a newbie in this field and I don't understand perfectly what the code does.
What I want to do is to extract the drag and lift forces from a porous medium and apply them to a structural model. So this is a FSI case as I see it.

After talking with @MakisH I have tried to replicate the structure of the CHT/Temperature.C file in the FSI/Force.C file, since the chanel-transport tutorial is the closest to what I want to do.

It compiles correctly so from a machine point of view it seems to be fine. I have created a simple case from the perpendicular-flap tutorial for testing. Where I create a openFOAM case with a porous medium in the middle of the domain. Also I modified the structural case made also in openFOAM to set the flap in the same position of the porous medium.
It seems that there is communication between fluid-openfoam and solid-openfoam. When I open the cases with paraview I get the force field. The problem is that the values of that field are practically zero. I guess I am not reading the forces produced by the porous medium. I know that openfoam calculates them with the functionObject force so I understand that somehow it could be used with preCICE.

Could you give me a path to follow and go fordward in this project?

Thank you in advance

from openfoam-adapter.

MakisH avatar MakisH commented on July 28, 2024

I have tried to replicate the structure of the CHT/Temperature.C file in the FSI/Force.C file, since the chanel-transport tutorial is the closest to what I want to do.

@sroget could you please link to your code? You can fork this repository and push to a branch. I am not sure I understand what you have done.

Which branches of the adapter are you based upon? We have not yet merged the volume coupling related changes (see #255 and #270, as well as precice/tutorials#315).

When I open the cases with paraview I get the force field. The problem is that the values of that field are practically zero. I guess I am not reading the forces produced by the porous medium. I know that openfoam calculates them with the functionObject force so I understand that somehow it could be used with preCICE.

Try checking where this force field comes from. For surface coupling, we are computing the forces explicitly in the adapter (that's why you also need to provide a density in the preciceDict, at least for incompressible solvers). I am not sure what happens when you also use the Forces function object at the same time, since both the adapter and the Forces function object would write into the same field.

I am not sure if or how we can access fields computed by other function objects, but we had such an idea before. Related: #143 I assume one would need to remove our own forces calculation and then check for forces objects registered in the OpenFOAM Objects Registry.

from openfoam-adapter.

sroget avatar sroget commented on July 28, 2024

Thank you very much for your time @MakisH . I am sorry for not expressing correctly what I have done. I will try to write it better.

Summary
I have copied the main branch of the adapter and compiled and installed it. I have modified the tutorial perpendicular flap where I have kept the structural part and modified the fluid participant by a case with porous medium.

And I have followed two paths:

1 Path: Modify FSI/Forces

1.1 First I tried to run preCICE modifying only precicedict as in the tutorial channel-transport with openfoam. In the following image you can see the expected error.

image

1.2 Modify FSI/Forces file to avoid the error. The code compiles but I get a Force field that does not read the forces that I am able to get through functionObject.

image

1.3 I modify functionObject/force --> functionObject/myForce to save the forces produced by the porous medium to try to visualize in paraview how it should look like. I only modified NO_WRITE to AUTO_WRITE.

image

At this point preCICE still gives me an empty force field. I don't know how to solve this and stop here. In the following image you can see what I get with the functionObject/myForce

image

2 Path:Create FSI/porousForce

2.1 I copy VV/Velocity and modify it to get a file called porousForce that does not give errors when I compiled it.

2.2 I run it to see what happens. It does not detect that there is a vectorField other than U.

image

2.3 I try to modify porousForce with no progress, the best I get back was an empty field as in 1.2.

As I see it I am not able to read the result of functionObject/myForce and send it to the structural solver. How can I do this? Also It seems that myForce is not saved in the ObjectRegistry

I will see how can I do that: --> Done. My files are in Sergio-openfoam-adapter inside the fork of this issue. You have the test case and the FSI with the files that I modified

@sroget could you please link to your code? You can fork this repository and push to a branch. I am not sure I understand what you have done.

from openfoam-adapter.

MakisH avatar MakisH commented on July 28, 2024

Thanks for the details! Link to your fork: https://github.com/sroget/openfoam-adapter

Note that it does not look like the code would compile the changes from https://github.com/sroget/openfoam-adapter/tree/develop/Sergio-openfoam-adapter (the Make/files is not modified). I understand that you put it in a separate directory to be able to easily look at the original state, but I would strongly recommend that you just make another branch and modify the original files. This would make comparisons much much easier.

The error you get (failed lookup of porousForce (objectRegistry region0)) is something I expected. I don't know if that is because of your changes, or because of how OpenFOAM function objects work. I always had this question: can we access the objects created by one function object via another function object? This is what we need to answer first.

from openfoam-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.