|
[Sponsors] |
Prescribing the Loading Condition in solids4Foam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 16, 2021, 06:43 |
Prescribing the Loading Condition in solids4Foam
|
#1 |
New Member
Sasan Tavakoli
Join Date: Sep 2018
Posts: 12
Rep Power: 7 |
HI All,
I am presently working on a structural analysis problem. But, I have a problem, which I think can be addressed but I am not very familiar with it. Assume that we have a boundary, a patch that represents one surface of a structure, such as the wing of an airplane, or bottom of a ship section, that is exposed to fluid loads. We have already simulated the fluid motion problem by using some mathematical models, which is performed in a unsteady framework. It means that we have the p(x,y,z,t) value. Here p is the pressure. At the current stage, we want to compute the deformation of the structure, of course over time, as it is exposed to this unsteady pressure. I am wondering how we can implement this condition. I have seen that we can do it for displacement. But, can we do it for pressure distribution over the a surface, which itself varies over the time. Just to make it clearer, we can have a .txt or .dat output for pressure distribution, that gives five column, including time, x, y, z and pressure. We have also rows, each of which refers to a specific time-step. In general, we can get the output in the way we want. Thank you in advance, Sasan |
|
February 17, 2021, 07:54 |
|
#2 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Hi Sasan,
It will not be too difficult to make a custom version of the solidTraction boundary condition which reads in csv/txt files of the pressure distribution. The challenge will be how we can interpolate/map this data to the OpenFOAM patch, as I am guessing the number of points are not the same. Do you have thoughts on conceptually how to do this? Philip |
|
February 17, 2021, 19:05 |
|
#3 |
New Member
Sasan Tavakoli
Join Date: Sep 2018
Posts: 12
Rep Power: 7 |
Hi Philip
Thank you for your reply. It's a bit flexible. I have a grid on the surface. You are right. Number of points on my own code, are different from the one I generate in solids4foam. I can go through three different approaches: 1) I can get the force distribution on the surface. i.e, I can divide the surface into a bunch of patches, like 20, 30 or whatever, and then give the time history of the force vector for each of these patches as a txt file. Each txt file then include four columns. The first one is time, the next ones are the force in x, y and z directions. 2) I can use only one force file. In this case, I don't divide the surface into sub-surfaces. I assume all surface is a single patch and prescribe the time history of the force on this patch. But, the problem is that we need to also prescribe the center of forces as it varies over the time. I can save the center of forces in x, y and z direction. But, i don't know whether it helps or not. 3) I can get a pressure distribution file. In this case, I can save a text file with a large number of columns. Each column represents one point on the surface. We will then have the time history of the pressure at each point. We can have different rows, and each row corresponds to a special time-step. I think the first one can be a good option. We just need to have some txt file, each corresponding to one patch. |
|
March 11, 2021, 13:07 |
|
#4 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Hi Sasan,
Hmnn the challenge here is to map/interpolate from your point cloud to the patch. There are definitely many ways to do this so I guess it is about funding the easiest way to do it that is still sufficiently accurate. If there are not too many points in the point cloud, the radial basis functions (RBF) may be a straight-forward approach e.g. as can be used for mapping data at the FSI interface. We could re-use the code from the FSI class (rbfInterfaceToInterfaceMapping.[HC]); basically the code there allows mapping from one point cloud to another. This would allow you to read in your "X Y Z pressure" data and then map this point cloud to the patch faces at every time-step. However, this will require some coding (how do you feel about that?). You can see the code at: Code:
solids4foam-release/src/solids4FoamModels/fluidSolidInterfaces/fluidSolidInterface/interfaceToInterfaceMapping/rbfInterfaceToInterfaceMapping/rbfInterfaceToInterfaceMapping.C Code:
void rbfInterfaceToInterfaceMapping::makeZoneAToZoneBInterpolator() const { ... std::shared_ptr<RBFFunctionInterface> rbfFunction; rbfFunction = std::shared_ptr<RBFFunctionInterface>(new TPSFunction()); zoneAToZoneBInterpolatorPtr_ = std::shared_ptr<RBFInterpolation> ( new RBFInterpolation(rbfFunction) ); const vectorField zoneBFaceCentres = zoneB().faceCentres(); const vectorField zoneAFaceCentres = zoneA().faceCentres(); matrix zoneAX(zoneAFaceCentres.size(), 3); matrix zoneBX(zoneBFaceCentres.size(), 3); forAll(zoneAFaceCentres, faceI) { zoneAX(faceI, 0) = zoneAFaceCentres[faceI].x(); zoneAX(faceI, 1) = zoneAFaceCentres[faceI].y(); zoneAX(faceI, 2) = zoneAFaceCentres[faceI].z(); } forAll(zoneBFaceCentres, faceI) { zoneBX(faceI, 0) = zoneBFaceCentres[faceI].x(); zoneBX(faceI, 1) = zoneBFaceCentres[faceI].y(); zoneBX(faceI, 2) = zoneBFaceCentres[faceI].z(); } zoneAToZoneBInterpolatorPtr_->compute(zoneAX, zoneBX); ... } Then an example mapping/interpolation is performed just after this: Code:
matrix zoneAXatZoneB(zoneBFaceCentres.size(), 3); zoneAToZoneBInterpolatorPtr_->interpolate(zoneAX, zoneAXatZoneB); vectorField zoneAFaceCentresAtZoneB(zoneBFaceCentres.size(), vector::zero); forAll(zoneAFaceCentresAtZoneB, faceI) { zoneAFaceCentresAtZoneB[faceI].x() = zoneAXatZoneB(faceI, 0); zoneAFaceCentresAtZoneB[faceI].y() = zoneAXatZoneB(faceI, 1); zoneAFaceCentresAtZoneB[faceI].z() = zoneAXatZoneB(faceI, 2); } const scalar maxDist = gMax ( mag(zoneAFaceCentresAtZoneB - zoneBFaceCentres) ); If you are able to add this code into a new custom boundary condition (derived from solidTraction) then I can help advise on coding issues. Philip |
|
September 29, 2021, 02:49 |
|
#5 |
New Member
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4 |
Dear Sasan,
I would like to know if you managed to handle this problem and if you have some tips towards this approach. Greetings! |
|
September 29, 2021, 04:16 |
|
#6 | |
New Member
Sasan Tavakoli
Join Date: Sep 2018
Posts: 12
Rep Power: 7 |
Quote:
Hi George. Thank you for your message. I liked to do it. But, I have been busy, so I didn't go deep through in it. Are you aiming to do so? |
||
September 29, 2021, 04:33 |
|
#7 |
New Member
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4 |
Dear Sasan,
I am working on a digital twin approach for an aircraft wing for my thesis. For this, I would like to have a One-Way-FSI and a Two-Way-FSI where both are coupled with a dynamic mesh (time depending rotation of the wing). I have existing models in ANSYS, but because of software and license problems and because of the code sharing approach I would like to switch to OpenFOAM. Sad to hear that you don't have the time to finish the project. But do you have any other information on this topic which are not already mentioned in this thread? Greetings! |
|
September 29, 2021, 04:39 |
|
#8 | |
New Member
Sasan Tavakoli
Join Date: Sep 2018
Posts: 12
Rep Power: 7 |
Quote:
That's an interesting topic. I do not have any update about it. But, Philip can help you. I am pretty sure. If you managed to do so, please let me know. |
||
September 29, 2021, 04:43 |
|
#9 |
New Member
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4 |
Anyway, many thanks for your reply!
Maybe he sees the replies.. I would like to share the full content if I could manage to get everything started! |
|
September 29, 2021, 04:44 |
|
#10 |
New Member
Sasan Tavakoli
Join Date: Sep 2018
Posts: 12
Rep Power: 7 |
||
September 30, 2021, 05:44 |
|
#11 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
One solution to this is to make a traction boundary condition using the functionality from the timeVaryingMappedFixedValue boundary condition. Tian Tang actually did this in her minigeotechfoam e.g. see here: https://bitbucket.org/tiantang/minig...TotalTraction/.
In that case, she creates a temporary "sigma_s" field which uses timeVaryingMappedFixedValue to look up point cloud data of pressures from the case (see here: https://bitbucket.org/tiantang/minig.../boundaryData/). Then in the timeVaryMappedTotalTraction condition, she looks up this sigma_s field and uses the values of pressure on its boundary as the traction to be applied. This approach is nice as it does not require too much additional coding, although I am sure it is possible to remove the need for an additional field. Philip |
|
September 30, 2021, 05:49 |
|
#12 | |
New Member
Sasan Tavakoli
Join Date: Sep 2018
Posts: 12
Rep Power: 7 |
Quote:
Thank you very much Philip. That's so useful. |
||
October 5, 2021, 12:16 |
|
#13 | |
New Member
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4 |
Dear Foamers,
thanks for your fast reply and sorry for my late ones. I am "fighting on many fronts" at the moment. Sadly, I didn't get running what you (Philip) told us to try. I understand the idea of calculating a temporary field, but I don't know how to realize that. Only from studying the code, I couldn't figure it out until now. Would it be enough to copy the boundary condition and compile it under the other boundaries? I also tried to run the minigeotechfoam but it does not work. Can anyone give me some more hinds to push this idea forward? As I thought again about the realization I think this Quote:
Since in my case the patches of the fluid interface surface and the solid interface surface should match, there shouldn't be a problem with interpolation, correct? Regarding this, I could take the cell data of the patches from time/p/i and directly use it for the time-varying pressure profile in solids4Foam. The problem here would be, how to find and sort the cells in the p-file of the time steps corresponding to the interface patches. By my research I found the following resources which could possibly help: Exporting fields via paraview Exporting velocity fileds data with node number and position Importing fields via software tool Import xyz data Export nodal forces Export forces at each nodes with OpenFoam I am really sorry if my questions are newby, but I am not really deep into programming and OpenFOAM, so I am really happy about any help. Greetings! |
||
October 6, 2021, 09:37 |
|
#14 |
New Member
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4 |
Dear Foamers,
I spend some more hours on this topic and would like to come back with further questions. General questions:
Further, I have some questions on minigeotechfoam - just to have a clear understanding:
Lastly, I like to point out my idea again, starting with the export process:
Then over to the import process:
If this demand proposal is an option there would be two additional questions:
Again, I appreciate every idea and every help on this topic! Thanks in advice. Greetings! |
|
October 26, 2021, 06:18 |
|
#15 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Hi Philipp,
How about the following:
|
|
October 26, 2021, 19:36 |
|
#16 | |
New Member
Sasan Tavakoli
Join Date: Sep 2018
Posts: 12
Rep Power: 7 |
Quote:
Hi Philip I can do it for you. Will come back to you soon. Cheers, Sasan |
||
October 28, 2021, 07:54 |
|
#17 |
New Member
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4 |
Hi guys,
first of all, many thanks for your reply, Philip! Second, sorry for my late reply. I made just a really easy case based on the movingCylinder tutorial from solids4Foam (fluids). You can find it here https://github.com/Philipp-Conen/OpenFOAM_QuadInFluid. It is running with FE 4.1. Is this sufficient? I would be also interested in helping you to push forward this approach. Do you have any easy tasks with which I can contribute to your work? Greetings Philipp |
|
November 24, 2021, 08:59 |
|
#18 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Thanks for this, and sorry for the delay.
Have a look at commit c81df36f. solidTraction now allows the pressure field to be specified from another vol field; if this other field uses the timeVaryingMappedFixedValue condition then it essentially allows the pressure field to be specified by a point cloud. Have a look at the included tutorial. If this makes sense (I think it does) then I can add the same option for a traction field. Let me know your thoughts. Philip |
|
November 24, 2021, 12:00 |
|
#19 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
I added the traction field option now too in 0a00b6c9.
It is currently on the development branch but I will merge it to the master once I have ported it to the other versions (currently I only checked foam-extend-4.0). Philip |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The difference of cyclic boundry condition and mapped boundary condition | caitao | OpenFOAM Running, Solving & CFD | 1 | December 4, 2019 07:29 |
Similar boundary condition to zero flux condition | Navip | OpenFOAM Running, Solving & CFD | 0 | August 13, 2015 04:04 |
Accessing multiple boundary patches from a custom boundary condition file | ripudaman | OpenFOAM Programming & Development | 0 | October 22, 2014 18:34 |
what "If" condition means in rebound | brbbhatti | OpenFOAM Programming & Development | 0 | August 12, 2014 09:18 |
Internal flow operating condition? | kookguy | FLUENT | 2 | June 26, 2014 00:15 |