Is there a way to calculate the aperture of two lenses stacked together for macro? In my specific case, I have 90mm f/2.8 and 18mm 1/3.5 lenses.
If you want to precalculate the value, I imagine it's possible, but I don't know how.
If you have the two lenses and want to determine through experimentation what the effective f/stop is, that's doable.
First mount the one of the lenses. Put camera in manual mode, and take a shot of something, preferably a neutral gray card. Something that is a solid color would be best. Set the shutter speed so that you get a good exposure.
Now add the reversed lens. With the same fixed ISO, take shots of the same subject (card) and with a range of shutter speeds. Because this will now be a macro shot of a small area of your original subject, that's why I suggested a solid color. Be careful that you are not blocking your light source with the lens.
Then compare those shots and find one that matches the tones of that first shot.
The difference in shutter speeds will tell you the additional stops of light beyond f/2.8 that you've lost by adding the second lens.
So if the original shot was at 1/60, and you have a shot with the two lenses at 1/15 that roughly matches the brightness of the original, then that's two full stops (1/60 --> 1/30 --> 1/15), so your effective aperture is f/5.6 ( f/2.8 --> f/4 --> f/5.6 )
Mike is correct in his comment, the entrance pupil diameter often changes when you reverse a lens. Many true macro lenses have a 1:1 ratio (or very nearly so) of entrance to exit pupil...so if you reverse a true macro lens, your entrance pupil through the back of the lens is about the same as through the front. The same is not necessarily true for non-macro lenses, however, and "physical aperture diameter" is the same as the "entrance pupil diameter" as seen through the entry element of the lens. When reversing a lens, the entry element is often smaller, thereby explicitly limiting pupil size.
You would need to know the magnification factor of both lenses, and for the reversed lens, the magnification factor when viewing through the back of the lens. That can be difficult to learn without a detailed understanding of the lens, including explicit focal length as well as any extension length, and if a retrofocal group is present, you would also need to know the effect of that. If you can find detailed design patents for the lenses your working with, you may be able to glean enough information to discern the necessary information to calculate effective aperture of the whole system.
If you need a quick and dirty but fairly accurate way to measure the difference in aperture with the single base lens and the reversed lens, a simple approach would be to take two shots, one with the single lens, and one with the whole system, at max aperture, same shutter and ISO. Adjust the exposure of the second shot until it appears to be the same with a post processing tool (I recommend Lightroom, as it has an excellent side-by-side compare mode). When the gray card tone of the two images matches, you can compute the difference of the aperture with the second lens in stops by how many EV of exposure adjustment was necessary. Once you know the difference, you would simply need to add that to any aperture you set the base lens to to compute the necessary exposure.